Commit graph

206259 commits

Author SHA1 Message Date
Xiretza 7507ee29fc Migrate "expected identifier" diagnostics to diagnostic structs 2022-09-27 20:29:19 +02:00
Xiretza 21b5194a3a Rework "inner attribute not permitted" errors 2022-09-27 20:29:19 +02:00
Xiretza 4d0519a4e7 Remove error condition in parse_attribute
This function is only ever called when the `#` has already been
consumed, no need to produce an error message here.
2022-09-27 20:29:19 +02:00
Xiretza e1b1d7b029 Migrate more rustc_parse diagnostics to diagnostic structs 2022-09-27 20:29:18 +02:00
Xiretza e56d6a68db Move rustc_parse diagnostic structs to separate module 2022-09-27 20:29:18 +02:00
Xiretza 6ae7a30927 Migrate "invalid literal suffix" diagnostic to diagnostic structs 2022-09-27 20:29:18 +02:00
Xiretza ab7c7dc7ce Migrate more diagnostics in rustc_parse to diagnostic structs 2022-09-27 20:29:18 +02:00
Xiretza 4d02892acf Allow raw identifiers to be used as fluent arguments 2022-09-27 20:29:18 +02:00
Xiretza 8489a67f0b Implement IntoDiagnosticArg for rustc_ast::Path 2022-09-27 20:29:18 +02:00
Xiretza 495e271883 Migrate rustc_session::expr_parentheses_needed to Subdiagnostic struct 2022-09-27 20:29:18 +02:00
bors 57ee5cf5a9 Auto merge of #102306 - lcnr:rustc_hir_analysis, r=compiler-errors
rename rustc_typeck to rustc_hir_analysis

first part of https://github.com/rust-lang/compiler-team/issues/529

r? `@compiler-errors`
2022-09-27 10:45:57 +00:00
lcnr 1fc86a63f4 rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
bors d9297d22ad Auto merge of #102314 - TaKO8Ki:add-label-to-struct-enum-union-ident, r=estebank
Add a label to struct/enum/union ident name

Based on https://github.com/rust-lang/rust/pull/94996#discussion_r831694150
cc: `@estebank`
2022-09-27 07:30:11 +00: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
Takayuki Maeda 5d05908c70 fix a ui test 2022-09-27 10:28:53 +09:00
Takayuki Maeda 4f44dee501 add a label to struct/enum/union ident name 2022-09-27 10:28:50 +09:00
Takayuki Maeda e123a61297 create a new local var 2022-09-27 10:22:46 +09: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