]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoAuto merge of #100845 - timvermeulen:iter_compare, r=scottmcm
bors [Sat, 24 Sep 2022 04:04:46 +0000 (04:04 +0000)]
Auto merge of #100845 - timvermeulen:iter_compare, r=scottmcm

Use internal iteration in `Iterator` comparison methods

Updates the `Iterator` methods `cmp_by`, `partial_cmp_by`, and `eq_by` to use internal iteration on `self`. I've also extracted their shared logic into a private helper function `iter_compare`, which will either short-circuit once the comparison result is known or return the comparison of the lengths of the iterators.

This change also indirectly benefits calls to `cmp`, `partial_cmp`, `eq`, `lt`, `le`, `gt`, and `ge`.

Unsurprising benchmark results: iterators that benefit from internal iteration (like `Chain`) see a speedup, while other iterators are unaffected.
```
 name                           before ns/iter  after ns/iter  diff ns/iter   diff %  speedup
 iter::bench_chain_partial_cmp  208,301         54,978             -153,323  -73.61%   x 3.79
 iter::bench_partial_cmp        55,527          55,702                  175    0.32%   x 1.00
 iter::bench_lt                 55,502          55,322                 -180   -0.32%   x 1.00
```

22 months agoDocument some missing command-line arguments
Eric Huss [Sat, 24 Sep 2022 02:02:59 +0000 (19:02 -0700)]
Document some missing command-line arguments

22 months agoAuto merge of #102068 - cjgillot:erased-lifetime-print, r=eholk
bors [Sat, 24 Sep 2022 01:23:17 +0000 (01:23 +0000)]
Auto merge of #102068 - cjgillot:erased-lifetime-print, r=eholk

Always print '_, even for erased lifetimes.

Explicit lifetime arguments are now the recommended syntax in rust 2018 and rust 2021.  This PR applies this discipline to rustc itself.

22 months agorustdoc: Stabilize --diagnostic-width
Eric Huss [Sat, 24 Sep 2022 01:04:15 +0000 (18:04 -0700)]
rustdoc: Stabilize --diagnostic-width

22 months agoRespond to document review feedback
Chris Wailes [Fri, 23 Sep 2022 23:14:17 +0000 (16:14 -0700)]
Respond to document review feedback

22 months agoBless miri.
Camille GILLOT [Fri, 23 Sep 2022 22:10:28 +0000 (00:10 +0200)]
Bless miri.

22 months agodiagnostics: avoid syntactically invalid suggestion in if conditionals
Michael Howell [Fri, 23 Sep 2022 20:24:35 +0000 (13:24 -0700)]
diagnostics: avoid syntactically invalid suggestion in if conditionals

Fixes #101065

22 months agoFix clippy's const fn stability check for CURRENT_RUSTC_VERSION
Nilstrieb [Fri, 23 Sep 2022 19:04:54 +0000 (21:04 +0200)]
Fix clippy's const fn stability check for CURRENT_RUSTC_VERSION

Since clippy can use a projects MSRV for its lints, it might not want
to consider functions as const stable if they have been added lately.

Functions that have been stabilized this version use
CURRENT_RUSTC_VERSION as their version, which gets then turned into the
current version, which might be something like `1.66.0-dev`. The version
parser cannot deal with this version, so it has to be stripped off.

22 months agoStabilize const `BTree{Map,Set}::new`
Nilstrieb [Fri, 23 Sep 2022 16:03:44 +0000 (18:03 +0200)]
Stabilize const `BTree{Map,Set}::new`

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.

22 months agoConstify Residual behind const_try
onestacked [Fri, 23 Sep 2022 18:17:31 +0000 (20:17 +0200)]
Constify Residual behind const_try

22 months agoMake `ManuallyDrop` satisfy `~const Destruct`
Deadbeef [Fri, 23 Sep 2022 18:07:36 +0000 (18:07 +0000)]
Make `ManuallyDrop` satisfy `~const Destruct`

22 months agoRemove unused `ConstFn(Once)Closure` structs.
onestacked [Fri, 23 Sep 2022 17:55:51 +0000 (19:55 +0200)]
Remove unused `ConstFn(Once)Closure` structs.

22 months agorustdoc: remove no-op CSS rule `#source-sidebar { z-index: 1 }`
Michael Howell [Fri, 23 Sep 2022 17:48:24 +0000 (10:48 -0700)]
rustdoc: remove no-op CSS rule `#source-sidebar { z-index: 1 }`

This rule became redundant in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114.
When `#source-sidebar` became nested below `.sidebar`, it went from being
`position: fixed` to `position: static`, and according to MDN's [z-index]
documentation, this means it has no effect.

[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index

22 months agorustdoc: remove no-op mobile CSS `#source-sidebar { z-index: 11 }`
Michael Howell [Fri, 23 Sep 2022 17:32:17 +0000 (10:32 -0700)]
rustdoc: remove no-op mobile CSS `#source-sidebar { z-index: 11 }`

This rule became redundant in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114.
When `#source-sidebar` became nested below `.sidebar`, it went from being
`position: fixed` to `position: static`, and according to MDN's [z-index]
documentation, this means it has no effect.

[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index

22 months agoAuto merge of #102192 - matthiaskrgr:rollup-0ctjzco, r=matthiaskrgr
bors [Fri, 23 Sep 2022 16:44:06 +0000 (16:44 +0000)]
Auto merge of #102192 - matthiaskrgr:rollup-0ctjzco, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #102094 (Add missing documentation for `bool::from_str`)
 - #102115 (Add examples to `bool::then` and `bool::then_some`)
 - #102134 (Detect panic strategy using `rustc --print cfg`)
 - #102137 (Don't convert valtree to constvalue during normalization)
 - #102148 (add regression test for miri issue 2433)
 - #102158 (rustdoc: clean up CSS/DOM for deprecation warnings)
 - #102177 (Fix a typo in `std`'s root docs)

Failed merges:

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

22 months agoBless clippy.
Camille GILLOT [Thu, 22 Sep 2022 17:39:38 +0000 (19:39 +0200)]
Bless clippy.

22 months agoBless 32bit ui.
Camille GILLOT [Wed, 21 Sep 2022 18:14:18 +0000 (20:14 +0200)]
Bless 32bit ui.

22 months agoBless pretty tests.
Camille GILLOT [Wed, 21 Sep 2022 17:09:43 +0000 (19:09 +0200)]
Bless pretty tests.

22 months agoBless cgu test.
Camille GILLOT [Tue, 20 Sep 2022 21:19:43 +0000 (23:19 +0200)]
Bless cgu test.

22 months agoAlways print '_, even for erased lifetimes.
Camille GILLOT [Sun, 11 Sep 2022 12:37:55 +0000 (14:37 +0200)]
Always print '_, even for erased lifetimes.

22 months agoAdded some spacing in const closure
onestacked [Fri, 23 Sep 2022 16:20:57 +0000 (18:20 +0200)]
Added some spacing in const closure

22 months agorustdoc: fix GUI tests to deal with slightly changed width
Michael Howell [Thu, 22 Sep 2022 18:51:48 +0000 (11:51 -0700)]
rustdoc: fix GUI tests to deal with slightly changed width

22 months agoImprove GUI tests by using variables
Guillaume Gomez [Fri, 23 Sep 2022 16:12:37 +0000 (18:12 +0200)]
Improve GUI tests by using variables

22 months agoUpdate browser-ui-test version to 0.11.0
Guillaume Gomez [Fri, 23 Sep 2022 16:12:23 +0000 (18:12 +0200)]
Update browser-ui-test version to 0.11.0

22 months agoAdded const Default impls for Arrays and Tuples.
onestacked [Fri, 23 Sep 2022 15:53:59 +0000 (17:53 +0200)]
Added const Default impls for Arrays and Tuples.

22 months agorustdoc: add regression test for sidebar width jank
Michael Howell [Thu, 22 Sep 2022 17:42:15 +0000 (10:42 -0700)]
rustdoc: add regression test for sidebar width jank

22 months agorustdoc: CSS prevent sidebar width change jank
Michael Howell [Thu, 22 Sep 2022 17:25:54 +0000 (10:25 -0700)]
rustdoc: CSS prevent sidebar width change jank

This commit makes the `width` and `min-width` of the sidebar the same. They
originally were when cad0fce2053d52b7ba04c458f4c124c8b5c6141e added the
`min-width` rule, but 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c changed the
width without changing the `min-width`, causing it to sometimes oscilate
between 200 and 250 pixels depending on the main content.

22 months agoRollup merge of #102177 - inquisitivecrystal:std-doc-typo, r=Dylan-DPC
Matthias Krüger [Fri, 23 Sep 2022 13:40:23 +0000 (15:40 +0200)]
Rollup merge of #102177 - inquisitivecrystal:std-doc-typo, r=Dylan-DPC

Fix a typo in `std`'s root docs

Remarkably, this typo has been present for *seven years.* I was so surprised that I reread the text five times and then asked people on the rust Zulip to double-check. :)

22 months agoRollup merge of #102158 - notriddle:notriddle/stab-p, r=GuillaumeGomez
Matthias Krüger [Fri, 23 Sep 2022 13:40:23 +0000 (15:40 +0200)]
Rollup merge of #102158 - notriddle:notriddle/stab-p, r=GuillaumeGomez

rustdoc: clean up CSS/DOM for deprecation warnings

Preview: https://notriddle.com/notriddle-rustdoc-test/stab-p/std/macro.try.html

22 months agoRollup merge of #102148 - RalfJung:miri-test, r=oli-obk
Matthias Krüger [Fri, 23 Sep 2022 13:40:22 +0000 (15:40 +0200)]
Rollup merge of #102148 - RalfJung:miri-test, r=oli-obk

add regression test for miri issue 2433

Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace.

Cc https://github.com/rust-lang/miri/issues/2433
r? ``@oli-obk``

22 months agoRollup merge of #102137 - b-naber:lazy-const-val-conversion, r=lcnr
Matthias Krüger [Fri, 23 Sep 2022 13:40:22 +0000 (15:40 +0200)]
Rollup merge of #102137 - b-naber:lazy-const-val-conversion, r=lcnr

Don't convert valtree to constvalue during normalization

r? ``@lcnr``

22 months agoRollup merge of #102134 - flba-eb:master, r=bjorn3
Matthias Krüger [Fri, 23 Sep 2022 13:40:21 +0000 (15:40 +0200)]
Rollup merge of #102134 - flba-eb:master, r=bjorn3

Detect panic strategy using `rustc --print cfg`

Instead of relying on a command line parameter, detect if a target is able to unwind or not.
Ignore tests that require unwinding on targets that don't support it.

I did not find any place where the removed parameter has been used, but it feels a bit risky as
I'm new to this test framework.

r? bjorn3

22 months agoRollup merge of #102115 - Alfriadox:master, r=thomcc
Matthias Krüger [Fri, 23 Sep 2022 13:40:20 +0000 (15:40 +0200)]
Rollup merge of #102115 - Alfriadox:master, r=thomcc

Add examples to `bool::then` and `bool::then_some`

Added examples to `bool::then` and `bool::then_some` to show the distinction between the eager evaluation of `bool::then_some` and the lazy evaluation of `bool::then`.

22 months agoRollup merge of #102094 - GuillaumeGomez:bool-from-str-missing-docs, r=scottmcm
Matthias Krüger [Fri, 23 Sep 2022 13:40:20 +0000 (15:40 +0200)]
Rollup merge of #102094 - GuillaumeGomez:bool-from-str-missing-docs, r=scottmcm

Add missing documentation for `bool::from_str`

Fixes #101870.

22 months agoFixed Doc-Tests
onestacked [Fri, 23 Sep 2022 13:39:13 +0000 (15:39 +0200)]
Fixed Doc-Tests

22 months agoAuto merge of #102056 - b-naber:unevaluated, r=lcnr
bors [Fri, 23 Sep 2022 13:39:11 +0000 (13:39 +0000)]
Auto merge of #102056 - b-naber:unevaluated, r=lcnr

Introduce mir::Unevaluated

Previously the distinction between unevaluated constants in the type-system and in mir was not explicit and a little confusing. Probably better to introduce its own type for that.

r? `@lcnr`

22 months agorename Unevaluated to UnevaluatedConst
b-naber [Thu, 22 Sep 2022 10:34:23 +0000 (12:34 +0200)]
rename Unevaluated to UnevaluatedConst

22 months agofix test
b-naber [Fri, 23 Sep 2022 12:25:30 +0000 (14:25 +0200)]
fix test

22 months agoUpdate doc after renaming fn is_zero
Florian Bartels [Fri, 23 Sep 2022 12:16:35 +0000 (14:16 +0200)]
Update doc after renaming fn is_zero

`fn is_zero` has been renamed to `fn count_is_zero` in
1b1bf2463619e23eba1b36b6d7df276ce73563dd.
This patch updates the documentation accordingly.

22 months agoConstifed Try trait
onestacked [Fri, 23 Sep 2022 11:43:34 +0000 (13:43 +0200)]
Constifed Try trait

22 months agoAdded const_closure
onestacked [Fri, 23 Sep 2022 11:42:31 +0000 (13:42 +0200)]
Added const_closure

22 months agoAuto merge of #102165 - matthiaskrgr:rollup-n5oquhe, r=matthiaskrgr
bors [Fri, 23 Sep 2022 09:33:23 +0000 (09:33 +0000)]
Auto merge of #102165 - matthiaskrgr:rollup-n5oquhe, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #100734 (Split out async_fn_in_trait into a separate feature)
 - #101664 (Note if mismatched types have a similar name)
 - #101815 (Migrated the rustc_passes annotation without effect diagnostic infrastructure)
 - #102042 (Distribute rust-docs-json via rustup.)
 - #102066 (rustdoc: remove unnecessary `max-width` on headers)
 - #102095 (Deduplicate two functions that would soon have been three)
 - #102104 (Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests)
 - #102112 (Allow full relro on powerpc64-unknown-linux-gnu)

Failed merges:

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

22 months agobootstrap: the backtrace feature is stable, no need to allow it any more
Ralf Jung [Fri, 23 Sep 2022 09:06:30 +0000 (11:06 +0200)]
bootstrap: the backtrace feature is stable, no need to allow it any more

22 months agoFix a typo in `std`'s root docs
inquisitivecrystal [Fri, 23 Sep 2022 08:40:57 +0000 (01:40 -0700)]
Fix a typo in `std`'s root docs

22 months agoAdd `llvm-dis` to the set of tools in `ci-llvm`
Miguel Ojeda [Thu, 22 Sep 2022 13:03:38 +0000 (15:03 +0200)]
Add `llvm-dis` to the set of tools in `ci-llvm`

The LLVM disassembler is needed for the test introduced in
https://github.com/rust-lang/rust/pull/97550.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
22 months agoRepair stderr test result to added line
Florian Bartels [Fri, 23 Sep 2022 08:10:07 +0000 (10:10 +0200)]
Repair stderr test result to added line

22 months agoAlso require other subtrees to always build successfully
Oli Scherer [Fri, 23 Sep 2022 08:03:10 +0000 (08:03 +0000)]
Also require other subtrees to always build successfully

22 months agoReport diagnostics at the actually actionable site
Oli Scherer [Fri, 23 Sep 2022 08:00:02 +0000 (08:00 +0000)]
Report diagnostics at the actually actionable site

22 months agoignore test cases when checking emscripten
Florian Bartels [Fri, 23 Sep 2022 07:41:12 +0000 (09:41 +0200)]
ignore test cases when checking emscripten

22 months agoSome test cleanups
Oli Scherer [Fri, 23 Sep 2022 07:18:33 +0000 (07:18 +0000)]
Some test cleanups

22 months agoMake the test actually show the problematic case
Oli Scherer [Fri, 23 Sep 2022 07:15:55 +0000 (07:15 +0000)]
Make the test actually show the problematic case

22 months agoShow errors instead of hiding them due to an earlier error
Oli Scherer [Fri, 23 Sep 2022 07:12:59 +0000 (07:12 +0000)]
Show errors instead of hiding them due to an earlier error

22 months agoShowcase a broken diagnostic
Oli Scherer [Fri, 23 Sep 2022 07:10:11 +0000 (07:10 +0000)]
Showcase a broken diagnostic

22 months agoAuto merge of #102150 - matthiaskrgr:rollup-6xmd8f3, r=matthiaskrgr
bors [Fri, 23 Sep 2022 06:52:39 +0000 (06:52 +0000)]
Auto merge of #102150 - matthiaskrgr:rollup-6xmd8f3, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #102113 (OpTy: fix a method taking self rather than &self)
 - #102118 (rustdoc: clean up line numbers on code examples)
 - #102123 (Add note to clippy::non_expressive_names doc)
 - #102125 (rustdoc: remove no-op CSS `.content .item-info { position: relative }`)
 - #102127 (Use appropriate variable names)
 - #102128 (Const unification is already infallible, remove the error handling logic)
 - #102133 (Use valtrees for comparison)
 - #102135 (Improve some AllTypes fields name)
 - #102144 (Extend const_convert with const {FormResidual, Try} for ControlFlow.)
 - #102147 (rustdoc: remove no-op CSS `.location:empty { border: none }`)

Failed merges:

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

22 months agoAdapt test results
Florian Bartels [Thu, 22 Sep 2022 13:18:17 +0000 (15:18 +0200)]
Adapt test results

22 months agoRestore ignore tag
Florian Bartels [Thu, 22 Sep 2022 12:25:10 +0000 (14:25 +0200)]
Restore ignore tag

This test case actually requires std::process.

22 months agoDetect panic strategy using `rustc --print cfg`
Florian Bartels [Thu, 22 Sep 2022 10:40:37 +0000 (12:40 +0200)]
Detect panic strategy using `rustc --print cfg`

Instead of relying on a command line parameter, detect if a target
is able to unwind or not.
Ignore tests that require unwinding on targets that don't support it.

22 months agorustfmt
Scott McMurray [Fri, 23 Sep 2022 06:13:12 +0000 (23:13 -0700)]
rustfmt

22 months agoMake ZST checks in core/alloc more readable
Scott McMurray [Fri, 23 Sep 2022 06:12:29 +0000 (23:12 -0700)]
Make ZST checks in core/alloc more readable

There's a bunch of these checks because of special handing for ZSTs in various unsafe implementations of stuff.

This lets them be `T::IS_ZST` instead of `mem::size_of::<T>() == 0` every time, making them both more readable and more terse.

*Not* proposed for stabilization at this time.  Would be `pub(crate)` except `alloc` wants to use it too.

(And while it doesn't matter now, if we ever get something like 85836 making it a const can help codegen be simpler.)

22 months agoAdd `#[inline]` to trivial functions on `core::sync::Exclusive`
Thom Chiovoloni [Fri, 23 Sep 2022 05:15:27 +0000 (22:15 -0700)]
Add `#[inline]` to trivial functions on `core::sync::Exclusive`

22 months agoAuto merge of #100488 - khyperia:invalid-calling-convention-help-message, r=nagisa...
bors [Fri, 23 Sep 2022 04:22:14 +0000 (04:22 +0000)]
Auto merge of #100488 - khyperia:invalid-calling-convention-help-message, r=nagisa,jyn514

Improve the help message for an invalid calling convention

Fixes https://github.com/rust-lang/rust/issues/93601

I mostly followed the suggestions of `@nagisa` in that issue, ~~however, I wasn't sure how to check stability for the suggestion of "Do not suggest CCs that cannot be used due to them being unstable and feature not being enabled", so I did not implement that point.~~

I haven't contributed to rustc much, please feel free to point out suggestions! For example, the `.map(|s| Symbol::intern(s)).collect::<Vec<_>>()` seems pretty gross performance-wise, but maybe that's OK in error reporting code.

22 months agoRollup merge of #102112 - cuviper:powerpc64-full-relro, r=eholk
Matthias Krüger [Fri, 23 Sep 2022 02:29:20 +0000 (04:29 +0200)]
Rollup merge of #102112 - cuviper:powerpc64-full-relro, r=eholk

Allow full relro on powerpc64-unknown-linux-gnu

This was previously limited to partial relro, citing issues on RHEL6,
but that's no longer a supported platform since #95026. We have long
been enabling full relro in RHEL7's own Rust builds for ppc64, without
trouble, so it should be fine to drop this workaround.

22 months agoRollup merge of #102104 - Aaron1011:no-test-backtrace, r=Mark-Simulacrum
Matthias Krüger [Fri, 23 Sep 2022 02:29:19 +0000 (04:29 +0200)]
Rollup merge of #102104 - Aaron1011:no-test-backtrace, r=Mark-Simulacrum

Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests

This allows the tests to pass even if the user has RUST_BACKTRACE set when running 'x.py'

22 months agoRollup merge of #102095 - oli-obk:simplify, r=TaKO8Ki
Matthias Krüger [Fri, 23 Sep 2022 02:29:19 +0000 (04:29 +0200)]
Rollup merge of #102095 - oli-obk:simplify, r=TaKO8Ki

Deduplicate two functions that would soon have been three

https://github.com/rust-lang/rust/pull/101900 would have added another copy of this for effects

22 months agoRollup merge of #102066 - notriddle:notriddle/headers-max-width, r=GuillaumeGomez
Matthias Krüger [Fri, 23 Sep 2022 02:29:18 +0000 (04:29 +0200)]
Rollup merge of #102066 - notriddle:notriddle/headers-max-width, r=GuillaumeGomez

rustdoc: remove unnecessary `max-width` on headers

This code was added in 003b2bc1c65251ec2fc80b78ed91c43fb35402ec to prevent these headers from overlapping `.out-of-band` side items. That stopped being a problem when 3f92ff34b5a2fe8dd1a32aa27d437519e63782f0 switched rustdoc over to using `float`, rather than `position: absolute`, to implement this.

22 months agoRollup merge of #102042 - LukeMathWalker:add-rust-json-docs-to-rustup, r=Mark-Simulacrum
Matthias Krüger [Fri, 23 Sep 2022 02:29:17 +0000 (04:29 +0200)]
Rollup merge of #102042 - LukeMathWalker:add-rust-json-docs-to-rustup, r=Mark-Simulacrum

Distribute rust-docs-json via rustup.

I am not 100% sure on how to treat `rust-json-docs` in `target_host_combination`. I went along with a similar strategy to the one used for `rust-docs`, but looking for guidance there.

22 months agoRollup merge of #101815 - diegooliveira:master, r=davidtwco
Matthias Krüger [Fri, 23 Sep 2022 02:29:16 +0000 (04:29 +0200)]
Rollup merge of #101815 - diegooliveira:master, r=davidtwco

Migrated the rustc_passes annotation without effect diagnostic infrastructure

Small change to move the validation for annotations to the new diagnostic infrastructure.

22 months agoRollup merge of #101664 - mejrs:similarity, r=fee1-dead
Matthias Krüger [Fri, 23 Sep 2022 02:29:16 +0000 (04:29 +0200)]
Rollup merge of #101664 - mejrs:similarity, r=fee1-dead

Note if mismatched types have a similar name

If users get a type error between similarly named types, it will point out that these are actually different types, and where they were defined.

22 months agoRollup merge of #100734 - ComputerDruid:afit_feature, r=compiler-errors
Matthias Krüger [Fri, 23 Sep 2022 02:29:15 +0000 (04:29 +0200)]
Rollup merge of #100734 - ComputerDruid:afit_feature, r=compiler-errors

Split out async_fn_in_trait into a separate feature

PR #101224 added support for async fn in trait desuraging behind the `return_position_impl_trait_in_trait` feature.

Split this out so that it's behind its own feature gate, since async fn in trait doesn't need to follow the same stabilization schedule.

22 months agoAuto merge of #101708 - compiler-errors:issue-101696, r=jackh726
bors [Fri, 23 Sep 2022 01:21:25 +0000 (01:21 +0000)]
Auto merge of #101708 - compiler-errors:issue-101696, r=jackh726

Normalize closure signature after construction

Astconv can't normalize inputs or outputs with escaping bound vars ([see this](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_typeck/check/fn_ctxt/mod.rs.html#294)), so normalize them after we've wrapped them in a binder.

Fixes #101696

22 months agorustdoc: fix unit tests
Michael Howell [Thu, 22 Sep 2022 22:41:32 +0000 (15:41 -0700)]
rustdoc: fix unit tests

22 months agorustdoc: clean up CSS/DOM for deprecation warnings
Michael Howell [Thu, 22 Sep 2022 21:54:38 +0000 (14:54 -0700)]
rustdoc: clean up CSS/DOM for deprecation warnings

22 months agoImprove the help message for an invalid calling convention
khyperia [Thu, 8 Sep 2022 13:37:15 +0000 (15:37 +0200)]
Improve the help message for an invalid calling convention

22 months agoCalculate ProjectionTy::trait_def_id correctly
Michael Goulet [Thu, 22 Sep 2022 19:36:26 +0000 (19:36 +0000)]
Calculate ProjectionTy::trait_def_id correctly

22 months agoRollup merge of #102147 - notriddle:notriddle/location-border-none, r=GuillaumeGomez
Matthias Krüger [Thu, 22 Sep 2022 19:34:56 +0000 (21:34 +0200)]
Rollup merge of #102147 - notriddle:notriddle/location-border-none, r=GuillaumeGomez

rustdoc: remove no-op CSS `.location:empty { border: none }`

This rule was added in 2bb2a2975f25e8ba7a372898e7e112f1cec5db01 to remove a border placed around the location when it's empty. That rule was removed in 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, so this rule does nothing.

22 months agoRollup merge of #102144 - chriss0612:const_convert_control_flow, r=scottmcm
Matthias Krüger [Thu, 22 Sep 2022 19:34:55 +0000 (21:34 +0200)]
Rollup merge of #102144 - chriss0612:const_convert_control_flow, r=scottmcm

Extend const_convert with const {FormResidual, Try} for ControlFlow.

Very small change so I just used the existing `const_convert` feature flag.  #88674
Newly const API:
```
impl<B, C> const ops::Try for ControlFlow<B, C>;
impl<B, C> const ops::FromResidual for ControlFlow<B, C>;
```

`@usbalbin` I hope it is ok that I added to your feature.

22 months agoRollup merge of #102135 - GuillaumeGomez:rename-alltypes-fields, r=notriddle
Matthias Krüger [Thu, 22 Sep 2022 19:34:55 +0000 (21:34 +0200)]
Rollup merge of #102135 - GuillaumeGomez:rename-alltypes-fields, r=notriddle

Improve some AllTypes fields name

r? `@notriddle`

22 months agoRollup merge of #102133 - b-naber:use-valtrees-in-fast-reject, r=lcnr
Matthias Krüger [Thu, 22 Sep 2022 19:34:54 +0000 (21:34 +0200)]
Rollup merge of #102133 - b-naber:use-valtrees-in-fast-reject, r=lcnr

Use valtrees for comparison

r? `@lcnr`

22 months agoRollup merge of #102128 - oli-obk:const_unification, r=lcnr
Matthias Krüger [Thu, 22 Sep 2022 19:34:53 +0000 (21:34 +0200)]
Rollup merge of #102128 - oli-obk:const_unification, r=lcnr

Const unification is already infallible, remove the error handling logic

r? `@lcnr`

is this expected to be used in the future? Right now it is dead code.

22 months agoRollup merge of #102127 - TaKO8Ki:use-appropriate-variable-names, r=lcnr
Matthias Krüger [Thu, 22 Sep 2022 19:34:52 +0000 (21:34 +0200)]
Rollup merge of #102127 - TaKO8Ki:use-appropriate-variable-names, r=lcnr

Use appropriate variable names

22 months agoRollup merge of #102125 - notriddle:notriddle/content-item-info, r=GuillaumeGomez
Matthias Krüger [Thu, 22 Sep 2022 19:34:52 +0000 (21:34 +0200)]
Rollup merge of #102125 - notriddle:notriddle/content-item-info, r=GuillaumeGomez

rustdoc: remove no-op CSS `.content .item-info { position: relative }`

This rule was added to help position the marker line in 110e7270ab7b0700ce714b8b1c7e509195dea2c4, which was a `position: absolute` pseudo-element that relied on its parent to put it in the right spot. (it was changed from a line to an arrow in 1ffb9cf8d75e6f8b9aa27a25c7bc56c7bb3a1c43, then a different arrow in ae3a53ff58cec7aca1dfd17479fca44b7f91491f).

The arrow was removed in 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0, so the `relative` position is no longer necessary.

22 months agoRollup merge of #102123 - schteve:clippy-note, r=Manishearth
Matthias Krüger [Thu, 22 Sep 2022 19:34:51 +0000 (21:34 +0200)]
Rollup merge of #102123 - schteve:clippy-note, r=Manishearth

Add note to clippy::non_expressive_names doc

Addresses confusion in rust-lang/rust-clippy#9514 by updating the lint docs.

22 months agoRollup merge of #102118 - notriddle:notriddle/line-numbers, r=GuillaumeGomez
Matthias Krüger [Thu, 22 Sep 2022 19:34:50 +0000 (21:34 +0200)]
Rollup merge of #102118 - notriddle:notriddle/line-numbers, r=GuillaumeGomez

rustdoc: clean up line numbers on code examples

* First commit switches from `display: inline-flex; width: 100%` to `display: flex`.

  `display: inline-flex` was used as part of https://github.com/rust-lang/rust/commit/e961d397cab900c55f8d8c104648852e2b63664e, the original commit that added these line numbers. Does anyone know why it was done this way?

* Second commit makes it so that toggling this checkbox will update the page in real time, just like changing themes does.

Preview: https://notriddle.com/notriddle-rustdoc-test/line-numbers/std/vec/struct.Vec.html

22 months agoRollup merge of #102113 - RalfJung:opty-assert-mem, r=oli-obk
Matthias Krüger [Thu, 22 Sep 2022 19:34:49 +0000 (21:34 +0200)]
Rollup merge of #102113 - RalfJung:opty-assert-mem, r=oli-obk

OpTy: fix a method taking self rather than &self

r? `@oli-obk`

22 months agomake Miri build in stage 0
Ralf Jung [Thu, 22 Sep 2022 19:01:23 +0000 (21:01 +0200)]
make Miri build in stage 0

22 months agoadd regression test for miri issue 2433
Ralf Jung [Thu, 22 Sep 2022 19:01:13 +0000 (21:01 +0200)]
add regression test for miri issue 2433

22 months agorustdoc: remove no-op CSS `.location:empty { border: none }`
Michael Howell [Thu, 22 Sep 2022 18:09:29 +0000 (11:09 -0700)]
rustdoc: remove no-op CSS `.location:empty { border: none }`

This rule was added in 2bb2a2975f25e8ba7a372898e7e112f1cec5db01 to remove a
border placed around the location when it's empty. That rule was removed in
6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, so this rule does nothing.

22 months agoAuto merge of #98840 - cjgillot:span-inline-ctxt, r=wesleywiser
bors [Thu, 22 Sep 2022 17:59:27 +0000 (17:59 +0000)]
Auto merge of #98840 - cjgillot:span-inline-ctxt, r=wesleywiser

Inline SyntaxContext in both encoded span representation.

The current interned representation for spans does not use the `ctxt_or_zero: u16` field.  This PR proposes to use this field to store the `SyntaxContext` of the interned span instead.  When `ctxt_or_zero` and the interned span's `ctxt` don't match, the inlined one takes precedence.

This allows to implement `Span::ctxt` and `Span::with_ctxt` with much less probability to access the interner.  Those functions are used a lot for hygiene, so this may be worth it.

22 months agoRevert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk"
Camille GILLOT [Tue, 20 Sep 2022 18:04:35 +0000 (20:04 +0200)]
Revert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk"

This reverts commit 2cb9a65684dba47c52de8fa938febf97a73e70a9, reversing
changes made to 750bd1a7ff3e010611b97ee75d30b7cbf5f3a03c.

22 months agoRevert "Auto merge of #101862 - cjgillot:lint-regression, r=oli-obk"
Camille GILLOT [Tue, 20 Sep 2022 18:03:40 +0000 (20:03 +0200)]
Revert "Auto merge of #101862 - cjgillot:lint-regression, r=oli-obk"

This reverts commit bc7b17cfe3bf08b618d1c7b64838053faeb1f590, reversing
changes made to 5253b0a0a1f366fad0ebed57597fcf2703b9e893.

22 months agoFix slight issues with stderr
Rageking8 [Thu, 22 Sep 2022 16:24:30 +0000 (00:24 +0800)]
Fix slight issues with stderr

22 months agoConstify {FormResidual, Try} for ControlFlow
onestacked [Thu, 22 Sep 2022 16:21:34 +0000 (18:21 +0200)]
Constify {FormResidual, Try} for ControlFlow

22 months agoChange UI test stderr
Rageking8 [Thu, 22 Sep 2022 16:02:50 +0000 (00:02 +0800)]
Change UI test stderr

22 months agorecover from struct nested in struct
Rageking8 [Thu, 22 Sep 2022 15:41:38 +0000 (23:41 +0800)]
recover from struct nested in struct

22 months agoUnify subdiagnostic attribute parsing
Xiretza [Wed, 14 Sep 2022 15:19:40 +0000 (17:19 +0200)]
Unify subdiagnostic attribute parsing

22 months agoAdd missing code="" attributes to suggestion subdiagnostics
Xiretza [Wed, 14 Sep 2022 09:38:31 +0000 (11:38 +0200)]
Add missing code="" attributes to suggestion subdiagnostics

22 months agoBetter error recovery in Subdiagnostic derive
Xiretza [Mon, 12 Sep 2022 19:11:49 +0000 (21:11 +0200)]
Better error recovery in Subdiagnostic derive

22 months agoExtract subdiagnostic attribute parsing
Xiretza [Mon, 12 Sep 2022 18:44:28 +0000 (20:44 +0200)]
Extract subdiagnostic attribute parsing

22 months agoMake SetOnce nicer to use
Xiretza [Sun, 11 Sep 2022 16:30:18 +0000 (18:30 +0200)]
Make SetOnce nicer to use

22 months agoPoint to previous applicability when declared multiple times
Xiretza [Sat, 10 Sep 2022 12:48:01 +0000 (14:48 +0200)]
Point to previous applicability when declared multiple times