Commit Graph

206244 Commits

Author SHA1 Message Date
lcnr
1fc86a63f4 rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
bors
de0b511daa Auto merge of #102189 - davidtwco:translation-derive-enums, r=compiler-errors
macros: diagnostic derive on enums

Part of #100717.

Extends `#[derive(Diagnostic)]` to work on enums too where each variant acts like a distinct diagnostic - being able to represent diagnostics this way can be quite a bit simpler for some parts of the compiler.

r? `@compiler-errors`
cc `@Xiretza`
2022-09-27 04:39:25 +00:00
bors
cd4d9d934f Auto merge of #102331 - notriddle:rollup-dmefd2d, r=notriddle
Rollup of 6 pull requests

Successful merges:

 - #102283 (Improve code example for Option::unwrap_or_default)
 - #102319 (rustdoc: merge CSS `table` rules into `.docblock`)
 - #102321 ( Rustdoc-Json: List impls for primitives)
 - #102322 (Document that Display automatically implements ToString)
 - #102325 (rustdoc: give `.line-number` / `.line-numbers` meaningful names)
 - #102326 (rustdoc: Update doc comment for splitn_mut to include mutable in the …)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-27 01:58:36 +00:00
bors
f3a6fbf2f2 Auto merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r=thomcc
Improve code example for Option::unwrap_or_default

Fixes #100054.
Follow-up of #102259.

r? `@thomcc`
2022-09-26 23:17:52 +00:00
Michael Howell
7381d7d8b2
Rollup merge of #102326 - yancyribbens:splin-mut-doc-change, r=thomcc
rustdoc: Update doc comment for splitn_mut to include mutable in the …

The doc comment for [splitn](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L2051:L2056) is the exact same as the comment for [splitn_mut](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L2079:L2084).  The doc comment for `splitn_mut` should instead say it's working on a mutable subslice.
2022-09-26 15:40:55 -07:00
Michael Howell
76b21341a8
Rollup merge of #102325 - notriddle:notriddle/line-number, r=GuillaumeGomez
rustdoc: give `.line-number` / `.line-numbers` meaningful names
2022-09-26 15:40:55 -07:00
Michael Howell
66bab6b781
Rollup merge of #102322 - sigaloid:master, r=GuillaumeGomez
Document that Display automatically implements ToString

Closes #92941

r? rust-lang/docs
2022-09-26 15:40:54 -07:00
Michael Howell
0415560382
Rollup merge of #102321 - aDotInTheVoid:rdj-prim-impls, r=GuillaumeGomez
Rustdoc-Json: List impls for primitives

 Closes #101695

 Partially addresses #100961

r? ``@GuillaumeGomez``
2022-09-26 15:40:54 -07:00
Michael Howell
dc4fb6b572
Rollup merge of #102319 - notriddle:notriddle/td-th, r=GuillaumeGomez
rustdoc: merge CSS `table` rules into `.docblock`

This was added in 510107815f, to fix the display of the module items and search results tables (see the discussion in https://github.com/rust-lang/rust/pull/86725).

Those aren't tables any more. The only remaining table is in docblock, which has its own padding declarations.
2022-09-26 15:40:53 -07:00
Michael Howell
2668a6839a
Rollup merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r=thomcc
Improve code example for Option::unwrap_or_default

Fixes #100054.
Follow-up of #102259.

r? ``@thomcc``
2022-09-26 15:40:52 -07:00
bors
8b705839cd Auto merge of #102324 - matthiaskrgr:rollup-6l70oz3, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #101875 (Allow more `!Copy` impls)
 - #101996 (Don't duplicate region names for late-bound regions in print of Binder)
 - #102181 (Add regression test)
 - #102273 (Allow `~const` bounds on non-const functions)
 - #102286 (Recover some items that expect braces and don't take semicolons)

Failed merges:

 - #102314 (Add a label to struct/enum/union ident name)

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-26 19:57:51 +00:00
Michael Howell
9ca2ae3fa7 rustdoc: simplify example-line-numbers CSS selector 2022-09-26 12:49:08 -07:00
Michael Howell
0b97831af7 rustdoc: give .line-number / .line-numbers meaningful names 2022-09-26 11:48:03 -07:00
yancy
40f404468a rustdoc: Update doc comment for splitn_mut to include mutable in the description 2022-09-26 20:20:13 +02:00
Matthias Krüger
6f5e8c2ed4
Rollup merge of #102286 - compiler-errors:recover-semi-in-block-item, r=davidtwco
Recover some items that expect braces and don't take semicolons

Fixes #102262
2022-09-26 19:19:21 +02:00
Matthias Krüger
e9bec2fdd4
Rollup merge of #102273 - woppopo:relax_const_bound, r=fee1-dead
Allow `~const` bounds on non-const functions

Makes the behavior of bound of trait-associated functions and non-associated functions consistent.
2022-09-26 19:19:21 +02:00
Matthias Krüger
0857ddeed6
Rollup merge of #102181 - inquisitivecrystal:issue-100878-test, r=Mark-Simulacrum
Add regression test

This adds a regression test for issue #100878.

Closes #100878.
2022-09-26 19:19:20 +02:00
Matthias Krüger
b02062e886
Rollup merge of #101996 - b-naber:binder-print, r=lcnr
Don't duplicate region names for late-bound regions in print of Binder

Fixes https://github.com/rust-lang/rust/issues/101280
2022-09-26 19:19:20 +02:00
Matthias Krüger
4d4a3691e9
Rollup merge of #101875 - fmease:allow-more-negative-copy-impls, r=lcnr
Allow more `!Copy` impls

You can already implement `!Copy` for a lot of types (with `#![feature(negative_impls)]`). However, before this PR you could not implement `!Copy` for ADTs whose fields don't implement `Copy` which didn't make any sense. Further, you couldn't implement `!Copy` for types impl'ing `Drop` (equally nonsensical).

``@rustbot`` label T-types F-negative_impls
Fixes #101836.

r? types
2022-09-26 19:19:19 +02:00
bors
1d1f142660 Auto merge of #102257 - cjgillot:let-else-lint, r=dingxiangfei2009
Fix lint scoping for let-else.

The scoping for let-else is inconsistent with HIR nesting.  This creates cases, in `ui/let-else/let-else-allow-unused.rs` for instance, where an `allow` lint attribute does not apply to the bindings created by `let-else`.

This PR is an attempt to correct this.

As there is no lint that currently relies on this, the test for this behaviour is https://github.com/rust-lang/rust/pull/101500.

cc `@dingxiangfei2009` as you filed https://github.com/rust-lang/rust/pull/101894
2022-09-26 17:17:07 +00:00
Nixon Enraght-Moony
aac7429c17 Rustdoc-Json: List impls for primitives
Closes #101695
2022-09-26 18:06:48 +01:00
Matthew Esposito
4fad063cba Document that Display entails ToString 2022-09-26 13:03:59 -04:00
Michael Howell
99904445b8 rustdoc: merge table { border-collapse } into .docblock table`
This was added in 510107815f, to fix the
display of the module items and search results tables (see the discussion in
https://github.com/rust-lang/rust/pull/86725).

Those aren't tables any more. The only remaining table is in docblock, which
needs this attribute to look right.
2022-09-26 09:54:44 -07:00
Michael Howell
1fe3ce476c rustdoc: remove unneeded CSS td, th { padding 0 }
This was added in 510107815f, to fix
the display of the module items and search results tables (see the discussion
in https://github.com/rust-lang/rust/pull/86725).

Those aren't tables any more. The only remaining table is in docblock, which
has its own padding declarations.
2022-09-26 09:20:20 -07:00
bors
e1d7dec558 Auto merge of #102051 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrum
Update bootstrap compiler to 1.65.0

This PR updates the bootstrap compiler to Rust 1.65.0, removing the various `cfg(bootstrap)`s.

r? `@Mark-Simulacrum`
2022-09-26 14:22:43 +00:00
b-naber
6118ee343f address review 2022-09-26 14:21:39 +02:00
bors
84946fe241 Auto merge of #102184 - chenyukang:fix-102087-add-binding-sugg, r=nagisa
Suggest Default::default() when binding isn't initialized

Fixes #102087
2022-09-26 11:41:58 +00:00
b-naber
897adb8666 bless tests 2022-09-26 13:10:56 +02:00
b-naber
456f4e8d22 don't duplicate late-bound region names in print of Binder 2022-09-26 13:10:55 +02:00
David Wood
f20c882b8b macros: support diagnostic derive on enums
Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-26 11:59:19 +01:00
Guillaume Gomez
475aeab79e Improve code example for Option::unwrap_or_default 2022-09-26 12:37:41 +02:00
Pietro Albini
f7b0c858a5
actually fix line number 2022-09-26 10:14:52 +02:00
Pietro Albini
81cfb14d99
fix line number in expected test output 2022-09-26 10:14:51 +02:00
Pietro Albini
e78507d97d
applease tidy 2022-09-26 10:14:50 +02:00
Pietro Albini
79ad2d5995
fix check_cfg 2022-09-26 10:14:48 +02:00
Pietro Albini
3975d55d98
remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
Pietro Albini
317cab9bef
bump stage0 2022-09-26 10:13:46 +02:00
Pietro Albini
d0305b3d00
replace stabilization placeholders 2022-09-26 10:13:44 +02:00
bors
21265dd0d2 Auto merge of #102224 - fee1-dead-contrib:const_trait_impl_specialization, r=oli-obk
Allow specializing on const trait bounds
2022-09-26 08:08:35 +00:00
bors
72f4923979 Auto merge of #102297 - fee1-dead-contrib:rollup-2np0cre, r=fee1-dead
Rollup of 5 pull requests

Successful merges:

 - #102143 (Recover from struct nested in struct)
 - #102178 (bootstrap: the backtrace feature is stable, no need to allow it any more)
 - #102197 (Stabilize const `BTree{Map,Set}::new`)
 - #102267 (Don't set RUSTC in the bootstrap build script)
 - #102270 (Remove benches from `rustc_middle`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-26 05:27:43 +00:00
fee1-dead
39c6bdc30d
Rollup merge of #102270 - Nilstrieb:delete-useless-benches, r=TaKO8Ki
Remove benches from `rustc_middle`

These benches benchmark rust langauge features and not the compiler, so they seem to be in the wrong place here. They also all take <1ns, making them pretty useless. Looking at their git history, they just seem to have been carried around for many, many years. This commit ends their journey.
2022-09-26 13:09:43 +08:00
fee1-dead
503b073d3f
Rollup merge of #102267 - jyn514:smaller-build-script, r=Mark-Simulacrum
Don't set RUSTC in the bootstrap build script

We no longer use this for anything since https://github.com/rust-lang/rust/pull/98483/files#diff-7eddc76f1be9eca2599a9ae58c65ffe247fbdff9b02ef687439894cab9afe749L781. Remove it, so that we spuriously rebuild bootstrap fewer times on Windows (where PATH changes often).

Helps with https://github.com/rust-lang/rust/issues/92369. cc https://github.com/rust-lang/rust/pull/102266

r? ``@Mark-Simulacrum``
2022-09-26 13:09:43 +08:00
fee1-dead
804c2c1ed9
Rollup merge of #102197 - Nilstrieb:const-new-🌲, r=Mark-Simulacrum
Stabilize const `BTree{Map,Set}::new`

The FCP was completed in #71835.

Since `len` and `is_empty` are not const stable yet, this also creates a new feature for them since they previously used the same `const_btree_new` feature.
2022-09-26 13:09:42 +08:00
fee1-dead
0cee03dfff
Rollup merge of #102178 - RalfJung:bootstrap-backtrace, r=Mark-Simulacrum
bootstrap: the backtrace feature is stable, no need to allow it any more
2022-09-26 13:09:42 +08:00
fee1-dead
0adf293f87
Rollup merge of #102143 - Rageking8:fix-101540, r=TaKO8Ki
Recover from struct nested in struct

Fixes #101540

r? `@TaKO8Ki`

Not sure If I have done it right.
2022-09-26 13:09:41 +08:00
woppopo
e4b08ab241 Allow ~const bounds on non-const functions 2022-09-26 05:00:31 +00:00
bors
fe217c28ff Auto merge of #102292 - fee1-dead-contrib:rollup-61ptdkt, r=fee1-dead
Rollup of 4 pull requests

Successful merges:

 - #101851 (Clean up (sub)diagnostic derives)
 - #102244 (Only generate closure def id for async fns with body)
 - #102263 (Clarify Iterator::rposition code example)
 - #102280 (rustdoc: clean up `.out-of-band`/`.in-band` CSS)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-26 02:45:13 +00:00
fee1-dead
a7d45de322
Rollup merge of #102280 - notriddle:notriddle/band, r=GuillaumeGomez
rustdoc: clean up `.out-of-band`/`.in-band` CSS

|        | method | impl
|--------|--------|------
| before | ![image](https://user-images.githubusercontent.com/1593513/192164603-dea9befb-0f5f-4bd5-a44d-1f8328e27955.png) | ![image](https://user-images.githubusercontent.com/1593513/192164642-06f958cb-8fd5-4b73-bdb7-d2778f358f80.png)
| after  | ![image](https://user-images.githubusercontent.com/1593513/192164612-f72ee8db-c87c-477c-99e8-283b1cf0c14b.png) | ![image](https://user-images.githubusercontent.com/1593513/192164653-8e628dc3-5bf3-4ce8-829b-06e27a90fe06.png)

* Remove the `float: right` fallback from the main header, which hasn't been needed since IE11 support was dropped.

* Remove `in-band` from low-level headers, which hasn't been needed since `.rightside` switched to `float: right` in 593d6d1cb1

* Remove unreachable `.in-band > code, .in-band > .code-header` CSS, since the `in-band` class was attached to the `code-header` itself, not nested directly below it.

* Use `rem` instead of `em` for code header margins.

* This results in a slight change in spacing around impls and item-info, but since it makes it more consistent with the way methods are presented, it's probably fine.

Preview: http://notriddle.com/notriddle-rustdoc-demos/band/std/fs/struct.File.html
2022-09-26 09:27:38 +08:00
fee1-dead
beb224084d
Rollup merge of #102263 - GuillaumeGomez:iterator-rposition-example, r=thomcc
Clarify Iterator::rposition code example

Fixes #101095.

r? `@thomcc`
2022-09-26 09:27:37 +08:00
fee1-dead
c807277382
Rollup merge of #102244 - compiler-errors:issue-102219, r=cjgillot
Only generate closure def id for async fns with body

Fixes #102219
2022-09-26 09:27:37 +08:00