]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoMigrate "expected semicolon" diagnostics to diagnostic structs
Xiretza [Sun, 4 Sep 2022 18:12:00 +0000 (20:12 +0200)]
Migrate "expected semicolon" diagnostics to diagnostic structs

21 months agoMigrate "expected identifier" diagnostics to diagnostic structs
Xiretza [Sun, 4 Sep 2022 08:14:00 +0000 (10:14 +0200)]
Migrate "expected identifier" diagnostics to diagnostic structs

21 months agoRework "inner attribute not permitted" errors
Xiretza [Wed, 31 Aug 2022 11:20:59 +0000 (13:20 +0200)]
Rework "inner attribute not permitted" errors

21 months agoRemove error condition in parse_attribute
Xiretza [Thu, 1 Sep 2022 17:29:59 +0000 (19:29 +0200)]
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.

21 months agoMigrate more rustc_parse diagnostics to diagnostic structs
Xiretza [Thu, 1 Sep 2022 17:29:23 +0000 (19:29 +0200)]
Migrate more rustc_parse diagnostics to diagnostic structs

21 months agoMove rustc_parse diagnostic structs to separate module
Xiretza [Tue, 30 Aug 2022 11:19:17 +0000 (13:19 +0200)]
Move rustc_parse diagnostic structs to separate module

21 months agoMigrate "invalid literal suffix" diagnostic to diagnostic structs
Xiretza [Thu, 15 Sep 2022 08:12:09 +0000 (10:12 +0200)]
Migrate "invalid literal suffix" diagnostic to diagnostic structs

21 months agoMigrate more diagnostics in rustc_parse to diagnostic structs
Xiretza [Wed, 24 Aug 2022 20:41:51 +0000 (22:41 +0200)]
Migrate more diagnostics in rustc_parse to diagnostic structs

21 months agoAllow raw identifiers to be used as fluent arguments
Xiretza [Wed, 14 Sep 2022 18:12:22 +0000 (20:12 +0200)]
Allow raw identifiers to be used as fluent arguments

21 months agoImplement IntoDiagnosticArg for rustc_ast::Path
Xiretza [Wed, 14 Sep 2022 17:22:20 +0000 (19:22 +0200)]
Implement IntoDiagnosticArg for rustc_ast::Path

21 months agoMigrate rustc_session::expr_parentheses_needed to Subdiagnostic struct
Xiretza [Thu, 25 Aug 2022 08:58:53 +0000 (10:58 +0200)]
Migrate rustc_session::expr_parentheses_needed to Subdiagnostic struct

21 months agoAuto merge of #102306 - lcnr:rustc_hir_analysis, r=compiler-errors
bors [Tue, 27 Sep 2022 10:45:57 +0000 (10:45 +0000)]
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`

21 months agorustc_typeck to rustc_hir_analysis
lcnr [Mon, 26 Sep 2022 11:00:29 +0000 (13:00 +0200)]
rustc_typeck to rustc_hir_analysis

21 months agoAuto merge of #102314 - TaKO8Ki:add-label-to-struct-enum-union-ident, r=estebank
bors [Tue, 27 Sep 2022 07:30:11 +0000 (07:30 +0000)]
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`

21 months agoAuto merge of #102189 - davidtwco:translation-derive-enums, r=compiler-errors
bors [Tue, 27 Sep 2022 04:39:25 +0000 (04:39 +0000)]
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`

21 months agoAuto merge of #102331 - notriddle:rollup-dmefd2d, r=notriddle
bors [Tue, 27 Sep 2022 01:58:36 +0000 (01:58 +0000)]
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

21 months agofix a ui test
Takayuki Maeda [Mon, 26 Sep 2022 14:43:31 +0000 (23:43 +0900)]
fix a ui test

21 months agoadd a label to struct/enum/union ident name
Takayuki Maeda [Mon, 26 Sep 2022 14:13:38 +0000 (23:13 +0900)]
add a label to struct/enum/union ident name

21 months agocreate a new local var
Takayuki Maeda [Mon, 26 Sep 2022 14:13:09 +0000 (23:13 +0900)]
create a new local var

21 months agoAuto merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r=thomcc
bors [Mon, 26 Sep 2022 23:17:52 +0000 (23:17 +0000)]
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`

21 months agoRollup merge of #102326 - yancyribbens:splin-mut-doc-change, r=thomcc
Michael Howell [Mon, 26 Sep 2022 22:40:55 +0000 (15:40 -0700)]
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.

21 months agoRollup merge of #102325 - notriddle:notriddle/line-number, r=GuillaumeGomez
Michael Howell [Mon, 26 Sep 2022 22:40:55 +0000 (15:40 -0700)]
Rollup merge of #102325 - notriddle:notriddle/line-number, r=GuillaumeGomez

rustdoc: give `.line-number` / `.line-numbers` meaningful names

21 months agoRollup merge of #102322 - sigaloid:master, r=GuillaumeGomez
Michael Howell [Mon, 26 Sep 2022 22:40:54 +0000 (15:40 -0700)]
Rollup merge of #102322 - sigaloid:master, r=GuillaumeGomez

Document that Display automatically implements ToString

Closes #92941

r? rust-lang/docs

21 months agoRollup merge of #102321 - aDotInTheVoid:rdj-prim-impls, r=GuillaumeGomez
Michael Howell [Mon, 26 Sep 2022 22:40:54 +0000 (15:40 -0700)]
Rollup merge of #102321 - aDotInTheVoid:rdj-prim-impls, r=GuillaumeGomez

 Rustdoc-Json: List impls for primitives

 Closes #101695

 Partially addresses #100961

r? ``@GuillaumeGomez``

21 months agoRollup merge of #102319 - notriddle:notriddle/td-th, r=GuillaumeGomez
Michael Howell [Mon, 26 Sep 2022 22:40:53 +0000 (15:40 -0700)]
Rollup merge of #102319 - notriddle:notriddle/td-th, r=GuillaumeGomez

rustdoc: merge CSS `table` rules into `.docblock`

This was added in 510107815fe888319028c5e96001cdee70e7a931, 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.

21 months agoRollup merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r...
Michael Howell [Mon, 26 Sep 2022 22:40:52 +0000 (15:40 -0700)]
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``

21 months agoAuto merge of #102324 - matthiaskrgr:rollup-6l70oz3, r=matthiaskrgr
bors [Mon, 26 Sep 2022 19:57:51 +0000 (19:57 +0000)]
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

21 months agorustdoc: simplify example-line-numbers CSS selector
Michael Howell [Mon, 26 Sep 2022 19:21:27 +0000 (12:21 -0700)]
rustdoc: simplify example-line-numbers CSS selector

21 months agorustdoc: give `.line-number` / `.line-numbers` meaningful names
Michael Howell [Mon, 26 Sep 2022 17:50:51 +0000 (10:50 -0700)]
rustdoc: give `.line-number` / `.line-numbers` meaningful names

21 months agorustdoc: Update doc comment for splitn_mut to include mutable in the description
yancy [Mon, 26 Sep 2022 18:20:13 +0000 (20:20 +0200)]
rustdoc: Update doc comment for splitn_mut to include mutable in the description

21 months agoRollup merge of #102286 - compiler-errors:recover-semi-in-block-item, r=davidtwco
Matthias Krüger [Mon, 26 Sep 2022 17:19:21 +0000 (19:19 +0200)]
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

21 months agoRollup merge of #102273 - woppopo:relax_const_bound, r=fee1-dead
Matthias Krüger [Mon, 26 Sep 2022 17:19:21 +0000 (19:19 +0200)]
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.

21 months agoRollup merge of #102181 - inquisitivecrystal:issue-100878-test, r=Mark-Simulacrum
Matthias Krüger [Mon, 26 Sep 2022 17:19:20 +0000 (19:19 +0200)]
Rollup merge of #102181 - inquisitivecrystal:issue-100878-test, r=Mark-Simulacrum

Add regression test

This adds a regression test for issue #100878.

Closes #100878.

21 months agoRollup merge of #101996 - b-naber:binder-print, r=lcnr
Matthias Krüger [Mon, 26 Sep 2022 17:19:20 +0000 (19:19 +0200)]
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

21 months agoRollup merge of #101875 - fmease:allow-more-negative-copy-impls, r=lcnr
Matthias Krüger [Mon, 26 Sep 2022 17:19:19 +0000 (19:19 +0200)]
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

21 months agoAuto merge of #102257 - cjgillot:let-else-lint, r=dingxiangfei2009
bors [Mon, 26 Sep 2022 17:17:07 +0000 (17:17 +0000)]
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

21 months ago Rustdoc-Json: List impls for primitives
Nixon Enraght-Moony [Mon, 26 Sep 2022 17:06:48 +0000 (18:06 +0100)]
 Rustdoc-Json: List impls for primitives

 Closes #101695

21 months agoDocument that Display entails ToString
Matthew Esposito [Mon, 26 Sep 2022 16:50:45 +0000 (12:50 -0400)]
Document that Display entails ToString

21 months agorustdoc: merge `table { border-collapse } into `.docblock table`
Michael Howell [Mon, 26 Sep 2022 16:54:44 +0000 (09:54 -0700)]
rustdoc: merge `table { border-collapse } into `.docblock table`

This was added in 510107815fe888319028c5e96001cdee70e7a931, 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.

21 months agorustdoc: remove unneeded CSS `td, th { padding 0 }`
Michael Howell [Mon, 26 Sep 2022 16:20:20 +0000 (09:20 -0700)]
rustdoc: remove unneeded CSS `td, th { padding 0 }`

This was added in 510107815fe888319028c5e96001cdee70e7a931, 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.

21 months agoAuto merge of #102051 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrum
bors [Mon, 26 Sep 2022 14:22:43 +0000 (14:22 +0000)]
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`

21 months agoaddress review
b-naber [Wed, 21 Sep 2022 15:57:30 +0000 (17:57 +0200)]
address review

21 months agoAuto merge of #102184 - chenyukang:fix-102087-add-binding-sugg, r=nagisa
bors [Mon, 26 Sep 2022 11:41:58 +0000 (11:41 +0000)]
Auto merge of #102184 - chenyukang:fix-102087-add-binding-sugg, r=nagisa

Suggest Default::default() when binding isn't initialized

Fixes #102087

21 months agobless tests
b-naber [Sun, 18 Sep 2022 20:02:56 +0000 (22:02 +0200)]
bless tests

21 months agodon't duplicate late-bound region names in print of Binder
b-naber [Thu, 15 Sep 2022 16:46:40 +0000 (18:46 +0200)]
don't duplicate late-bound region names in print of Binder

21 months agomacros: support diagnostic derive on enums
David Wood [Fri, 23 Sep 2022 11:49:02 +0000 (12:49 +0100)]
macros: support diagnostic derive on enums

Signed-off-by: David Wood <david.wood@huawei.com>
21 months agoImprove code example for Option::unwrap_or_default
Guillaume Gomez [Sun, 25 Sep 2022 21:58:33 +0000 (23:58 +0200)]
Improve code example for Option::unwrap_or_default

21 months agoactually fix line number
Pietro Albini [Fri, 23 Sep 2022 08:40:36 +0000 (10:40 +0200)]
actually fix line number

21 months agofix line number in expected test output
Pietro Albini [Wed, 21 Sep 2022 13:15:17 +0000 (15:15 +0200)]
fix line number in expected test output

21 months agoapplease tidy
Pietro Albini [Wed, 21 Sep 2022 07:24:00 +0000 (09:24 +0200)]
applease tidy

21 months agofix check_cfg
Pietro Albini [Tue, 20 Sep 2022 15:02:26 +0000 (17:02 +0200)]
fix check_cfg

21 months agoremove cfg(bootstrap)
Pietro Albini [Tue, 20 Sep 2022 13:41:42 +0000 (15:41 +0200)]
remove cfg(bootstrap)

21 months agobump stage0
Pietro Albini [Tue, 20 Sep 2022 10:44:15 +0000 (12:44 +0200)]
bump stage0

21 months agoreplace stabilization placeholders
Pietro Albini [Mon, 19 Sep 2022 12:54:16 +0000 (14:54 +0200)]
replace stabilization placeholders

21 months agoAuto merge of #102224 - fee1-dead-contrib:const_trait_impl_specialization, r=oli-obk
bors [Mon, 26 Sep 2022 08:08:35 +0000 (08:08 +0000)]
Auto merge of #102224 - fee1-dead-contrib:const_trait_impl_specialization, r=oli-obk

Allow specializing on const trait bounds

21 months agoAuto merge of #102297 - fee1-dead-contrib:rollup-2np0cre, r=fee1-dead
bors [Mon, 26 Sep 2022 05:27:43 +0000 (05:27 +0000)]
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

21 months agoRollup merge of #102270 - Nilstrieb:delete-useless-benches, r=TaKO8Ki
fee1-dead [Mon, 26 Sep 2022 05:09:43 +0000 (13:09 +0800)]
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.

21 months agoRollup merge of #102267 - jyn514:smaller-build-script, r=Mark-Simulacrum
fee1-dead [Mon, 26 Sep 2022 05:09:43 +0000 (13:09 +0800)]
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``

21 months agoRollup merge of #102197 - Nilstrieb:const-new-🌲, r=Mark-Simulacrum
fee1-dead [Mon, 26 Sep 2022 05:09:42 +0000 (13:09 +0800)]
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.

21 months agoRollup merge of #102178 - RalfJung:bootstrap-backtrace, r=Mark-Simulacrum
fee1-dead [Mon, 26 Sep 2022 05:09:42 +0000 (13:09 +0800)]
Rollup merge of #102178 - RalfJung:bootstrap-backtrace, r=Mark-Simulacrum

bootstrap: the backtrace feature is stable, no need to allow it any more

21 months agoRollup merge of #102143 - Rageking8:fix-101540, r=TaKO8Ki
fee1-dead [Mon, 26 Sep 2022 05:09:41 +0000 (13:09 +0800)]
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.

21 months agoAllow `~const` bounds on non-const functions
woppopo [Mon, 26 Sep 2022 05:00:31 +0000 (05:00 +0000)]
Allow `~const` bounds on non-const functions

21 months agoAuto merge of #102292 - fee1-dead-contrib:rollup-61ptdkt, r=fee1-dead
bors [Mon, 26 Sep 2022 02:45:13 +0000 (02:45 +0000)]
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

21 months agoRollup merge of #102280 - notriddle:notriddle/band, r=GuillaumeGomez
fee1-dead [Mon, 26 Sep 2022 01:27:38 +0000 (09:27 +0800)]
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 https://github.com/rust-lang/rust/commit/593d6d1cb15c55c88319470dabb40126c7b7f1e2

* 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

21 months agoRollup merge of #102263 - GuillaumeGomez:iterator-rposition-example, r=thomcc
fee1-dead [Mon, 26 Sep 2022 01:27:37 +0000 (09:27 +0800)]
Rollup merge of #102263 - GuillaumeGomez:iterator-rposition-example, r=thomcc

Clarify Iterator::rposition code example

Fixes #101095.

r? `@thomcc`

21 months agoRollup merge of #102244 - compiler-errors:issue-102219, r=cjgillot
fee1-dead [Mon, 26 Sep 2022 01:27:37 +0000 (09:27 +0800)]
Rollup merge of #102244 - compiler-errors:issue-102219, r=cjgillot

Only generate closure def id for async fns with body

Fixes #102219

21 months agoRollup merge of #101851 - Xiretza:diagnostic-derive-cleanups, r=davidtwco
fee1-dead [Mon, 26 Sep 2022 01:27:36 +0000 (09:27 +0800)]
Rollup merge of #101851 - Xiretza:diagnostic-derive-cleanups, r=davidtwco

Clean up (sub)diagnostic derives

The biggest chunk of this is unifying the parsing of subdiagnostic attributes (`#[error]`, `#[suggestion(...)]`, `#[label(...)]`, etc) between `Subdiagnostic` and `Diagnostic` type attributes as well as `Diagnostic` field attributes.

It also improves a number of proc macro diagnostics.

Waiting for #101558.

21 months agoAuto merge of #101785 - jyn514:query-struct-fn-ptrs, r=cjgillot
bors [Mon, 26 Sep 2022 00:17:59 +0000 (00:17 +0000)]
Auto merge of #101785 - jyn514:query-struct-fn-ptrs, r=cjgillot

Use function pointers instead of macro-unrolled loops in rustc_query_impl

By making these standalone functions, we
a) allow making them extensible in the future with a new `QueryStruct`
b) greatly decrease the amount of code in each individual function, avoiding exponential blowup in llvm

Helps with https://github.com/rust-lang/rust/issues/96524. Based on https://github.com/rust-lang/rust/pull/101173; only the last commit is relevant.

r? `@cjgillot`

21 months agofix #102087, Suggest Default::default() when binding isn't initialized
yukang [Fri, 23 Sep 2022 07:28:48 +0000 (15:28 +0800)]
fix #102087, Suggest Default::default() when binding isn't initialized

21 months agoOnly lower async fn body if it actually has a body
Michael Goulet [Sat, 24 Sep 2022 19:22:01 +0000 (19:22 +0000)]
Only lower async fn body if it actually has a body

21 months agoOnly generate closure def id for async fns with body
Michael Goulet [Sat, 24 Sep 2022 18:53:53 +0000 (18:53 +0000)]
Only generate closure def id for async fns with body

21 months agoRecover some items that expect braces and don't take semicolons
Michael Goulet [Sun, 25 Sep 2022 22:20:01 +0000 (22:20 +0000)]
Recover some items that expect braces and don't take semicolons

21 months agoRound offset to whole integer
Michael Howell [Sun, 25 Sep 2022 21:58:49 +0000 (14:58 -0700)]
Round offset to whole integer

21 months agoAuto merge of #101710 - jyn514:move-dep-kind-node, r=cjgillot
bors [Sun, 25 Sep 2022 21:37:10 +0000 (21:37 +0000)]
Auto merge of #101710 - jyn514:move-dep-kind-node, r=cjgillot

Move DepKindStruct from rustc_middle to rustc_query_system

Helps with https://github.com/rust-lang/rust/issues/96524. cc https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/Moving.20.60DepKindStruct.60.20to.20rustc_query_system.20.2396524

r? `@cjgillot`

21 months agorustdoc: update test cases now that code-header is used without in-band
Michael Howell [Sun, 25 Sep 2022 20:52:26 +0000 (13:52 -0700)]
rustdoc: update test cases now that code-header is used without in-band

21 months agorustdoc: clean up `.out-of-band`/`.in-band` CSS
Michael Howell [Sun, 25 Sep 2022 20:09:22 +0000 (13:09 -0700)]
rustdoc: clean up `.out-of-band`/`.in-band` CSS

* 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
  593d6d1cb15c55c88319470dabb40126c7b7f1e2

* 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.

21 months agoAuto merge of #95474 - oli-obk:tait_ub, r=jackh726
bors [Sun, 25 Sep 2022 19:15:26 +0000 (19:15 +0000)]
Auto merge of #95474 - oli-obk:tait_ub, r=jackh726

Neither require nor imply lifetime bounds on opaque type for well formedness

The actual hidden type can live arbitrarily longer than any individual lifetime and arbitrarily shorter than all but one of the lifetimes.

fixes #86218
fixes #84305

This is a **breaking change** but it is a necessary soundness fix

21 months agoMove the `codegen_unit` debug assert from `rustc_query_system` to `query_impl`
Joshua Nelson [Sun, 18 Sep 2022 21:35:48 +0000 (16:35 -0500)]
Move the `codegen_unit` debug assert from `rustc_query_system` to `query_impl`

This allows removing a function from the `DepKind` trait.

21 months agoMove some more code from rustc_middle to rustc_query_system
Joshua Nelson [Mon, 12 Sep 2022 04:31:50 +0000 (23:31 -0500)]
Move some more code from rustc_middle to rustc_query_system

21 months agoMove functions on `DepKindStruct` from rustc_middle to rustc_query_system
Joshua Nelson [Mon, 12 Sep 2022 04:18:08 +0000 (23:18 -0500)]
Move functions on `DepKindStruct` from rustc_middle to rustc_query_system

21 months agoMove `DepKindStruct` from rustc_middle to rustc_query_system
Joshua Nelson [Mon, 12 Sep 2022 02:10:53 +0000 (21:10 -0500)]
Move `DepKindStruct` from rustc_middle to rustc_query_system

21 months agoAuto merge of #102266 - Mark-Simulacrum:fix-custom-rustc, r=jyn514
bors [Sun, 25 Sep 2022 16:52:49 +0000 (16:52 +0000)]
Auto merge of #102266 - Mark-Simulacrum:fix-custom-rustc, r=jyn514

Support overriding initial rustc and cargo paths

This restores functionality broken by #98483. Unfortunately, it doesn't add a test to verify this works, but in this case we notice pretty quickly as perf uses this functionality and so reports breakage immediately after merging.

r? `@jyn514`

cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/rustc.20and.20cargo.20option.20broken.20in.20config.2Etoml, https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Rustc.20benchmark.20broken

21 months agoRemove benches from `rustc_middle`
Nilstrieb [Sun, 25 Sep 2022 16:35:43 +0000 (18:35 +0200)]
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.

21 months agoUse function pointers instead of macro-unrolled loops in rustc_query_impl
Joshua Nelson [Tue, 13 Sep 2022 23:32:22 +0000 (18:32 -0500)]
Use function pointers instead of macro-unrolled loops in rustc_query_impl

By making these standalone functions, we
a) allow making them extensible in the future with a new `QueryStruct`
b) greatly decrease the amount of code in each individual function, avoiding exponential blowup in llvm

21 months agoDon't set RUSTC in the bootstrap build script
Joshua Nelson [Sun, 25 Sep 2022 14:42:01 +0000 (09:42 -0500)]
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).

21 months agoAuto merge of #102265 - fee1-dead-contrib:rollup-a7fccbg, r=fee1-dead
bors [Sun, 25 Sep 2022 14:28:04 +0000 (14:28 +0000)]
Auto merge of #102265 - fee1-dead-contrib:rollup-a7fccbg, r=fee1-dead

Rollup of 8 pull requests

Successful merges:

 - #98111 (Clarify `[T]::select_nth_unstable*` return values)
 - #101431 (Look at move place's type when suggesting mutable reborrow)
 - #101800 (Constify slice.split_at_mut(_unchecked))
 - #101997 (Remove support for legacy PM)
 - #102194 (Note the type when unable to drop values in compile time)
 - #102200 (Constify Default impl's for Arrays and Tuples.)
 - #102245 (Constify cmp_min_max_by.)
 - #102259 (Type-annotate and simplify documentation of Option::unwrap_or_default)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

21 months agoSupport overriding initial rustc and cargo paths
Mark Rousskov [Sun, 25 Sep 2022 14:23:33 +0000 (10:23 -0400)]
Support overriding initial rustc and cargo paths

This restores functionality broken by #98483. Unfortunately, it doesn't
add a test to verify this works, but in this case we notice pretty
quickly as perf uses this functionality and so reports breakage
immediately after merging.

21 months agoRollup merge of #102259 - gimbles:patch-1, r=joshtriplett
fee1-dead [Sun, 25 Sep 2022 14:06:41 +0000 (22:06 +0800)]
Rollup merge of #102259 - gimbles:patch-1, r=joshtriplett

Type-annotate and simplify documentation of Option::unwrap_or_default

Part of #100054

21 months agoRollup merge of #102245 - ink-feather-org:const_cmp_by, r=fee1-dead
fee1-dead [Sun, 25 Sep 2022 14:06:40 +0000 (22:06 +0800)]
Rollup merge of #102245 - ink-feather-org:const_cmp_by, r=fee1-dead

Constify cmp_min_max_by.

Constifies `core::cmp::{min, max}_by[_key]` behind the `const_cmp` #92391 feature gate, using `const_closure`.

21 months agoRollup merge of #102200 - ink-feather-org:const_default_impls, r=fee1-dead
fee1-dead [Sun, 25 Sep 2022 14:06:40 +0000 (22:06 +0800)]
Rollup merge of #102200 - ink-feather-org:const_default_impls, r=fee1-dead

Constify Default impl's for Arrays and Tuples.

Allows to create arrays and tuples in const Context using the ~const Default implementation of the inner type.

21 months agoRollup merge of #102194 - fee1-dead-contrib:improve-const-drop, r=oli-obk
fee1-dead [Sun, 25 Sep 2022 14:06:39 +0000 (22:06 +0800)]
Rollup merge of #102194 - fee1-dead-contrib:improve-const-drop, r=oli-obk

Note the type when unable to drop values in compile time

21 months agoRollup merge of #101997 - cuviper:drop-legacy-pm, r=nikic
fee1-dead [Sun, 25 Sep 2022 14:06:38 +0000 (22:06 +0800)]
Rollup merge of #101997 - cuviper:drop-legacy-pm, r=nikic

Remove support for legacy PM

This removes support for optimizing with LLVM's legacy pass manager, as well as the unstable `-Znew-llvm-pass-manager` option. We have been defaulting to the new PM since LLVM 13 (except for s390x that waited for 14), and LLVM 15 removed support altogether. The only place we still use the legacy PM is for writing the output file, just like `llc` does.

cc #74705
r? ``@nikic``

21 months agoRollup merge of #101800 - chriss0612:feat/const_split_at_mut, r=fee1-dead
fee1-dead [Sun, 25 Sep 2022 14:06:38 +0000 (22:06 +0800)]
Rollup merge of #101800 - chriss0612:feat/const_split_at_mut, r=fee1-dead

Constify slice.split_at_mut(_unchecked)

Tracking Issue: [Tracking Issue for const_slice_split_at_mut](https://github.com/rust-lang/rust/issues/101804)

Feature gate: `#![feature(const_slice_split_at_mut)]`

Still requires const_mut_refs to be actually used, but this feature removes the need to manually re implement these functions in a user crate.

21 months agoRollup merge of #101431 - compiler-errors:move-place-ty-for-move-place-sugg, r=cjgillot
fee1-dead [Sun, 25 Sep 2022 14:06:37 +0000 (22:06 +0800)]
Rollup merge of #101431 - compiler-errors:move-place-ty-for-move-place-sugg, r=cjgillot

Look at move place's type when suggesting mutable reborrow

Not sure why we are looking at the use site's ty instead of the move site's ty in order to suggest reborrowing the move site, but it was suppressing a perfectly valid reborrow suggestion.

r? `@estebank` who i think touched this last in 520461f1fb2730f8edb17922f3bcc74fccdc52d3, though that was quite a while ago so feel free to reassign.

21 months agoRollup merge of #98111 - eggyal:issue-97982, r=GuillaumeGomez
fee1-dead [Sun, 25 Sep 2022 14:06:36 +0000 (22:06 +0800)]
Rollup merge of #98111 - eggyal:issue-97982, r=GuillaumeGomez

Clarify `[T]::select_nth_unstable*` return values

In cases where the nth element is not unique within the slice, it is not
correct to say that the values in the returned triplet include ones for
"all elements" less/greater than that at the given index: indeed one (or
more) such values would then also contain elements equal to that at
the given index.

The text proposed here clarifies exactly what is returned, but in so
doing it is also documenting an implementation detail that previously
wasn't detailed: namely that the returned slices are slices into the
reordered slice.  I don't think this can be contentious, because the
lifetimes of those returned slices are bound to that of the original
(now reordered) slice—so there really isn't any other reasonable
implementation that could have this behaviour; but nevertheless it's
probably best if `@rust-lang/libs-api` give it a nod?

Fixes #97982
r? `@m-ou-se`

`@rustbot` label +A-docs +C-bug +T-libs-api -T-libs

21 months agoClarify Iterator::rposition code example
Guillaume Gomez [Sun, 25 Sep 2022 12:09:41 +0000 (14:09 +0200)]
Clarify Iterator::rposition code example

21 months agoAuto merge of #100865 - compiler-errors:parent-substs-still, r=cjgillot
bors [Sun, 25 Sep 2022 12:00:37 +0000 (12:00 +0000)]
Auto merge of #100865 - compiler-errors:parent-substs-still, r=cjgillot

Don't drop parent substs when we have no generic parameters in `create_substs_for_ast_path`

This bug is being shadowed by an explicit check for `generics.params.is_empty()` in the only parent caller that could trigger it (`create_substs_for_associated_item`). I triggered it on another branch where I'm messing around with astconv stuff.

Also, the second commit simplifies `create_substs_for_associated_item`. Removing that explicit check I mentioned above^ and also the special case call to `Astconv::prohibit_generics` causes the UI test `src/test/ui/structs/struct-path-associated-type.stderr` to change, but I think that it's clearer now. The suggestion to remove the generics is actually useful.

21 months agoUpdate option.rs
Gimgim [Sun, 25 Sep 2022 10:18:08 +0000 (15:48 +0530)]
Update option.rs

21 months agoAuto merge of #102254 - matthiaskrgr:rollup-gitu6li, r=matthiaskrgr
bors [Sun, 25 Sep 2022 09:33:57 +0000 (09:33 +0000)]
Auto merge of #102254 - matthiaskrgr:rollup-gitu6li, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #102016 (implied_bounds: deal with inference vars)
 - #102161 (Resolve async fn signature even without body (e.g., in trait))
 - #102216 (rustdoc: Stabilize --diagnostic-width)
 - #102240 (rustdoc: remove unused CSS `#main-content > .line-numbers`)
 - #102242 (rustdoc: remove unused CSS `.summary`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

21 months agoFix scoping for let-else.
Camille GILLOT [Mon, 19 Sep 2022 20:53:21 +0000 (22:53 +0200)]
Fix scoping for let-else.