]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 agoRollup merge of #102242 - notriddle:notriddle/summary, r=GuillaumeGomez
Matthias Krüger [Sun, 25 Sep 2022 07:32:10 +0000 (09:32 +0200)]
Rollup merge of #102242 - notriddle:notriddle/summary, r=GuillaumeGomez

rustdoc: remove unused CSS `.summary`

It was added in 4d16de01d0beb84dc4a351022ea5cb587b4ab557 as part of a stability dashboard that was removed in 0a46933c4d81573e78ce16cd215ba155a3114fce.

21 months agoRollup merge of #102240 - notriddle:notriddle/main-line-numbers, r=GuillaumeGomez
Matthias Krüger [Sun, 25 Sep 2022 07:32:09 +0000 (09:32 +0200)]
Rollup merge of #102240 - notriddle:notriddle/main-line-numbers, r=GuillaumeGomez

rustdoc: remove unused CSS `#main-content > .line-numbers`

This selector was added in 10b937028660e079cf15735cfb5c4d58892fb10e. It became unreachable when 09150f81930e035254e58ee56f5905c2eb421617 made it so that `.line-numbers` are always nested below `.example-wrap`, even on source pages.

21 months agoRollup merge of #102216 - ehuss:rustdoc-diagnostic-width, r=notriddle
Matthias Krüger [Sun, 25 Sep 2022 07:32:09 +0000 (09:32 +0200)]
Rollup merge of #102216 - ehuss:rustdoc-diagnostic-width, r=notriddle

rustdoc: Stabilize --diagnostic-width

This stabilizes the `--diagnostic-width` flag for rustdoc. This flag was stabilized in rustc in #95635, but it isn't clear from the discussion there why it wasn't stabilized in rustdoc. I believe this flag works as expected, following the same behavior as rustc.

I'd like to stabilize this so that the same support can be stabilized in cargo, and it would help simplify things if both rustc and rustdoc supported it.

21 months agoRollup merge of #102161 - compiler-errors:issue-102138, r=tmandry
Matthias Krüger [Sun, 25 Sep 2022 07:32:08 +0000 (09:32 +0200)]
Rollup merge of #102161 - compiler-errors:issue-102138, r=tmandry

Resolve async fn signature even without body (e.g., in trait)

Fixes #102138

This "bail if no body" behavior was introduced in #69539 to fix #69401, but that ICE does not reproduce any more. The error message changes a bit, but that's all, and I don't think it's a particularly diagnostic bad regression.

21 months agoRollup merge of #102016 - lcnr:given-OutlivesEnvironment, r=jackh726
Matthias Krüger [Sun, 25 Sep 2022 07:32:07 +0000 (09:32 +0200)]
Rollup merge of #102016 - lcnr:given-OutlivesEnvironment, r=jackh726

implied_bounds: deal with inference vars

fixes #101951

while computing implied bounds for `<<T as ConstructionFirm>::Builder as BuilderFn<'_>>::Output` normalization replaces a projection with an inference var (adding a `Projection` obligation). Until we prove that obligation, this inference var remains unknown, which caused us to miss an implied bound necessary to prove that the unnormalized projection from the trait method signature is wf.

r? types

21 months agoAuto merge of #99609 - workingjubilee:lossy-unix-strerror, r=thomcc
bors [Sun, 25 Sep 2022 06:53:14 +0000 (06:53 +0000)]
Auto merge of #99609 - workingjubilee:lossy-unix-strerror, r=thomcc

Recover error strings on Unix from_lossy_utf8

Some language settings can result in unreliable UTF-8 being produced.
This can result in failing to emit the error string, panicking instead.
from_lossy_utf8 allows us to assume these strings usually will be fine.

This fixes rust-lang#99535.

21 months agoAuto merge of #98457 - japaric:gh98378, r=m-ou-se
bors [Sun, 25 Sep 2022 04:12:30 +0000 (04:12 +0000)]
Auto merge of #98457 - japaric:gh98378, r=m-ou-se

make Condvar, Mutex, RwLock const constructors work with the `unsupported` impl

applying this patch locally to the `rust-src` component fixes #98378

however, the solution seems wrong to me because PR #97791 didn't add any `rustc_const_stable` attribute to underlying implementations like `std::sys::unix::futex`, so I must be missing something about how const-stability is checked ... maybe the `restricted_std` feature (gate?) has an effect?

fixes #98378
fixes #98293 (probably)

21 months agoAuto merge of #102169 - scottmcm:constify-some-conditions, r=thomcc
bors [Sun, 25 Sep 2022 01:20:11 +0000 (01:20 +0000)]
Auto merge of #102169 - scottmcm:constify-some-conditions, r=thomcc

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

21 months agoAuto merge of #102040 - TaKO8Ki:separate-definitions-and-hir-owners, r=cjgillot
bors [Sat, 24 Sep 2022 22:42:07 +0000 (22:42 +0000)]
Auto merge of #102040 - TaKO8Ki:separate-definitions-and-hir-owners, r=cjgillot

Separate definitions and HIR owners in the type system

Fixes #83158

r? `@cjgillot`

21 months agoNote the type when unable to drop values in compile time
Deadbeef [Fri, 23 Sep 2022 14:22:36 +0000 (14:22 +0000)]
Note the type when unable to drop values in compile time

21 months agoConstify cmp_min_max_by
onestacked [Fri, 23 Sep 2022 16:47:47 +0000 (18:47 +0200)]
Constify cmp_min_max_by

21 months agoAuto merge of #98483 - dvtkrlbs:bootstrap-dist, r=jyn514
bors [Sat, 24 Sep 2022 20:00:51 +0000 (20:00 +0000)]
Auto merge of #98483 - dvtkrlbs:bootstrap-dist, r=jyn514

Distribute bootstrap in CI

This pre-compiles bootstrap from source and adds it to the existing `rust-dev` component. There are two main goals here:
1. Make it faster to build rust from source, both the first time and incrementally
2. Make it easier to add non-python entrypoints, since they can call out to bootstrap directly rather than having to figure out the right flags to pre-compile it. This second part is still in a bit of flux, see the tracking issue below for more information.

There are also several changes to make bootstrap able to run on a machine other than the one it was built (particularly around `config.src` and `config.out` detection). I (`@jyn514)` am slightly concerned these will regress unless tested - maybe we should add an automated test that runs bootstrap in a chroot or something? Unclear whether the effort is worth the test coverage.

Helps with https://github.com/rust-lang/rust/issues/94829.

21 months agoAdd test
Michael Goulet [Sat, 24 Sep 2022 19:04:25 +0000 (19:04 +0000)]
Add test

21 months agoOnly record extra lifetime params for async trait fn with no body
Michael Goulet [Fri, 23 Sep 2022 00:49:25 +0000 (00:49 +0000)]
Only record extra lifetime params for async trait fn with no body

21 months agoResolve async fn signature even without body (in trait)
Michael Goulet [Thu, 22 Sep 2022 22:53:32 +0000 (22:53 +0000)]
Resolve async fn signature even without body (in trait)

21 months agoAdd some more documentation
Scott McMurray [Sat, 24 Sep 2022 19:12:41 +0000 (12:12 -0700)]
Add some more documentation

21 months agoCopy `bootstrap.exe` on Windows, not `bootstrap`
Joshua Nelson [Sat, 24 Sep 2022 18:32:19 +0000 (13:32 -0500)]
Copy `bootstrap.exe` on Windows, not `bootstrap`

21 months agorustdoc: remove unused CSS `.summary`
Michael Howell [Sat, 24 Sep 2022 17:51:37 +0000 (10:51 -0700)]
rustdoc: remove unused CSS `.summary`

It was added in 4d16de01d0beb84dc4a351022ea5cb587b4ab557 as part of a
stability dashboard that was removed in
0a46933c4d81573e78ce16cd215ba155a3114fce.

21 months agorustdoc: remove unused CSS `#main-content > .line-numbers`
Michael Howell [Sat, 24 Sep 2022 17:03:59 +0000 (10:03 -0700)]
rustdoc: remove unused CSS `#main-content > .line-numbers`

This selector was added in 10b937028660e079cf15735cfb5c4d58892fb10e. It
became unreachable when 09150f81930e035254e58ee56f5905c2eb421617 made it so
that `.line-numbers` are always nested below `.example-wrap`, even on
source pages.

21 months agoAuto merge of #102234 - matthiaskrgr:rollup-5cb20l1, r=matthiaskrgr
bors [Sat, 24 Sep 2022 14:37:01 +0000 (14:37 +0000)]
Auto merge of #102234 - matthiaskrgr:rollup-5cb20l1, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #100823 (Refactor some `std` code that works with pointer offstes)
 - #102088 (Fix wrongly refactored Lift impl)
 - #102109 (resolve: Set effective visibilities for imports more precisely)
 - #102186 (Add const_closure, Constify Try trait)
 - #102203 (rustdoc: remove no-op CSS `#source-sidebar { z-index }`)
 - #102204 (Make `ManuallyDrop` satisfy `~const Destruct`)
 - #102210 (diagnostics: avoid syntactically invalid suggestion in if conditionals)
 - #102226 (bootstrap/miri: switch to non-deprecated env var for setting the sysroot folder)

Failed merges:

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

21 months agoseparate definitions and `HIR` owners
Takayuki Maeda [Tue, 20 Sep 2022 05:11:23 +0000 (14:11 +0900)]
separate definitions and `HIR` owners

fix a ui test

use `into`

fix clippy ui test

fix a run-make-fulldeps test

implement `IntoQueryParam<DefId>` for `OwnerId`

use `OwnerId` for more queries

change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`

21 months agoRollup merge of #102226 - RalfJung:miri-sysroot-build, r=oli-obk
Matthias Krüger [Sat, 24 Sep 2022 12:29:56 +0000 (14:29 +0200)]
Rollup merge of #102226 - RalfJung:miri-sysroot-build, r=oli-obk

bootstrap/miri: switch to non-deprecated env var for setting the sysroot folder

r? `@oli-obk`

21 months agoRollup merge of #102210 - notriddle:notriddle/did-you-mean, r=cjgillot
Matthias Krüger [Sat, 24 Sep 2022 12:29:56 +0000 (14:29 +0200)]
Rollup merge of #102210 - notriddle:notriddle/did-you-mean, r=cjgillot

diagnostics: avoid syntactically invalid suggestion in if conditionals

Fixes #101065

21 months agoRollup merge of #102204 - fee1-dead-contrib:manually-drop-trivially-drop, r=oli-obk
Matthias Krüger [Sat, 24 Sep 2022 12:29:55 +0000 (14:29 +0200)]
Rollup merge of #102204 - fee1-dead-contrib:manually-drop-trivially-drop, r=oli-obk

Make `ManuallyDrop` satisfy `~const Destruct`

21 months agoRollup merge of #102203 - notriddle:notriddle/source-sidebar, r=GuillaumeGomez
Matthias Krüger [Sat, 24 Sep 2022 12:29:55 +0000 (14:29 +0200)]
Rollup merge of #102203 - notriddle:notriddle/source-sidebar, r=GuillaumeGomez

rustdoc: remove no-op CSS `#source-sidebar { z-index }`

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

21 months agoRollup merge of #102186 - ink-feather-org:const_try_trait, r=fee1-dead
Matthias Krüger [Sat, 24 Sep 2022 12:29:54 +0000 (14:29 +0200)]
Rollup merge of #102186 - ink-feather-org:const_try_trait, r=fee1-dead

Add const_closure, Constify Try trait

Adds a struct for creating const `FnMut` closures (for now just copy pasted form my [const_closure](https://crates.io/crates/const_closure) crate).
I'm not sure if this way is how it should be done.
The `ConstFnClosure` and `ConstFnOnceClosure` structs can probably also be entirely removed.

This is then used to constify the try trait.

Not sure if i should add const_closure in its own pr and maybe make it public behind a perma-unstable feature gate.

cc ```@fee1-dead```  ```@rust-lang/wg-const-eval```

21 months agoRollup merge of #102109 - petrochenkov:addids, r=oli-obk
Matthias Krüger [Sat, 24 Sep 2022 12:29:53 +0000 (14:29 +0200)]
Rollup merge of #102109 - petrochenkov:addids, r=oli-obk

resolve: Set effective visibilities for imports more precisely

Instead of setting them for all primary and additional IDs of the import, only set them for the binding's true ID.

21 months agoRollup merge of #102088 - oli-obk:cleanups, r=bjorn3
Matthias Krüger [Sat, 24 Sep 2022 12:29:53 +0000 (14:29 +0200)]
Rollup merge of #102088 - oli-obk:cleanups, r=bjorn3

Fix wrongly refactored Lift impl

see https://github.com/rust-lang/rust/pull/101858#issuecomment-1252713639

r? ``@bjorn3``

21 months agoRollup merge of #100823 - WaffleLapkin:less_offsets, r=scottmcm
Matthias Krüger [Sat, 24 Sep 2022 12:29:52 +0000 (14:29 +0200)]
Rollup merge of #100823 - WaffleLapkin:less_offsets, r=scottmcm

Refactor some `std` code that works with pointer offstes

This PR replaces `pointer::offset` in standard library with `pointer::add` and `pointer::sub`, [re]moving some casts and using `.addr()` while we are at it.

This is a more complicated refactor than all other sibling PRs, so take a closer look when reviewing, please 😃  (though I've checked this multiple times and it looks fine).

r? ````@scottmcm````

_split off from #100746, continuation of #100822_

21 months agoAuto merge of #102167 - thomcc:exclusive-inline, r=scottmcm
bors [Sat, 24 Sep 2022 12:17:53 +0000 (12:17 +0000)]
Auto merge of #102167 - thomcc:exclusive-inline, r=scottmcm

Add `#[inline]` to trivial functions on `core::sync::Exclusive`

When optimizing for size things like these sometimes don't inlined even though they're generic. This is bad because they're no-ops.

Only dodgy one is poll I guess since it forwards to the inner poll, but it's not like we're doing `#[inline(always)]` here.

21 months agoAuto merge of #102064 - cjgillot:revert, r=Mark-Simulacrum
bors [Sat, 24 Sep 2022 09:36:29 +0000 (09:36 +0000)]
Auto merge of #102064 - cjgillot:revert, r=Mark-Simulacrum

Revert perf-regression 101620

Reverts #101862 #101620

r? `@Mark-Simulacrum`

21 months agoAuto merge of #102223 - matthiaskrgr:rollup-wb1qdhk, r=matthiaskrgr
bors [Sat, 24 Sep 2022 06:55:32 +0000 (06:55 +0000)]
Auto merge of #102223 - matthiaskrgr:rollup-wb1qdhk, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #101780 (Add a platform support document for Android)
 - #102044 (Remove `RtlGenRandom` (take two))
 - #102081 (Adding ignore fuchsia tests for execvp (pre_exec))
 - #102082 (Adding ignore fuchsia non-applicable commands)
 - #102146 (rustdoc: CSS prevent sidebar width change jank)
 - #102152 (Calculate `ProjectionTy::trait_def_id` for return-position `impl Trait` in trait correctly)
 - #102175 (Also require other subtrees to always build successfully)
 - #102176 (Add `llvm-dis` to the set of tools in `ci-llvm`)
 - #102188 (Update doc after renaming `fn is_zero`)
 - #102199 (Improve rustdoc GUI tests)
 - #102218 (Document some missing command-line arguments)

Failed merges:

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

21 months agobootstrap/miri: switch to non-deprecated env var for setting the sysroot folder
Ralf Jung [Sat, 24 Sep 2022 06:53:40 +0000 (08:53 +0200)]
bootstrap/miri: switch to non-deprecated env var for setting the sysroot folder

21 months agoRollup merge of #102218 - ehuss:rustc-flags, r=JohnTitor
Matthias Krüger [Sat, 24 Sep 2022 05:38:58 +0000 (07:38 +0200)]
Rollup merge of #102218 - ehuss:rustc-flags, r=JohnTitor

Document some missing command-line arguments

The rustc command-line arguments docs should document all of the stable arguments for rustc. Two were missing, `--force-warn` which was somewhat documented in the lint-levels chapter, but should also include a mention in the arguments list.  `--diagnostic-width` was stabilized in #95635, but the docs weren't updated.

21 months agoRollup merge of #102199 - GuillaumeGomez:improve-rustdoc-gui-tests, r=notriddle
Matthias Krüger [Sat, 24 Sep 2022 05:38:58 +0000 (07:38 +0200)]
Rollup merge of #102199 - GuillaumeGomez:improve-rustdoc-gui-tests, r=notriddle

Improve rustdoc GUI tests

I finally finished the update so we can now store values in variables and use them. It improves things nicely.

r? ``@notriddle``

21 months agoRollup merge of #102188 - flba-eb:doc_missed_at_rename, r=jyn514
Matthias Krüger [Sat, 24 Sep 2022 05:38:57 +0000 (07:38 +0200)]
Rollup merge of #102188 - flba-eb:doc_missed_at_rename, r=jyn514

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.

21 months agoRollup merge of #102176 - ojeda:add-llvm-dis-to-ci-llvm, r=Mark-Simulacrum
Matthias Krüger [Sat, 24 Sep 2022 05:38:56 +0000 (07:38 +0200)]
Rollup merge of #102176 - ojeda:add-llvm-dis-to-ci-llvm, r=Mark-Simulacrum

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>
21 months agoRollup merge of #102175 - oli-obk:miri_subtree_cleanup, r=jyn514
Matthias Krüger [Sat, 24 Sep 2022 05:38:56 +0000 (07:38 +0200)]
Rollup merge of #102175 - oli-obk:miri_subtree_cleanup, r=jyn514

Also require other subtrees to always build successfully

r? ``@jyn514``

21 months agoRollup merge of #102152 - compiler-errors:issue-102140, r=fee1-dead
Matthias Krüger [Sat, 24 Sep 2022 05:38:56 +0000 (07:38 +0200)]
Rollup merge of #102152 - compiler-errors:issue-102140, r=fee1-dead

Calculate `ProjectionTy::trait_def_id` for return-position `impl Trait` in trait correctly

Fixes #102140

21 months agoRollup merge of #102146 - notriddle:notriddle/sidebar-jank, r=GuillaumeGomez
Matthias Krüger [Sat, 24 Sep 2022 05:38:55 +0000 (07:38 +0200)]
Rollup merge of #102146 - notriddle:notriddle/sidebar-jank, r=GuillaumeGomez

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.

# Before

[Screencast from 09-22-2022 10:25:29 AM.webm](https://user-images.githubusercontent.com/1593513/191813469-ea00f30f-6f49-40fc-9a26-e1dfd5068d2b.webm)

# After

[Screencast from 09-22-2022 10:32:20 AM.webm](https://user-images.githubusercontent.com/1593513/191813642-ae0902da-5262-403a-bbdf-995334201acb.webm)

21 months agoRollup merge of #102082 - andrewpollack:uid-ignore, r=tmandry
Matthias Krüger [Sat, 24 Sep 2022 05:38:54 +0000 (07:38 +0200)]
Rollup merge of #102082 - andrewpollack:uid-ignore, r=tmandry

Adding ignore fuchsia non-applicable commands

Adding ignore fuchsia non-applicable commands

cc `@djkoloski`

r? `@tmandry`

21 months agoRollup merge of #102081 - andrewpollack:add-execvp-calls-ignore, r=tmandry
Matthias Krüger [Sat, 24 Sep 2022 05:38:54 +0000 (07:38 +0200)]
Rollup merge of #102081 - andrewpollack:add-execvp-calls-ignore, r=tmandry

Adding ignore fuchsia tests for execvp (pre_exec)

Adding ignore fuchsia tests for pre_exec, which calls execvp

cc. `@djkoloski`

r? `@tmandry`

21 months agoRollup merge of #102044 - ChrisDenton:BCrypt-system-rand, r=thomcc
Matthias Krüger [Sat, 24 Sep 2022 05:38:53 +0000 (07:38 +0200)]
Rollup merge of #102044 - ChrisDenton:BCrypt-system-rand, r=thomcc

Remove `RtlGenRandom` (take two)

First try to use the system preferred RNG but if that fails (e.g. due to a broken system configuration) then fallback to manually opening an algorithm handle.

21 months agoRollup merge of #101780 - chriswailes:android-platform, r=joshtriplett
Matthias Krüger [Sat, 24 Sep 2022 05:38:52 +0000 (07:38 +0200)]
Rollup merge of #101780 - chriswailes:android-platform, r=joshtriplett

Add a platform support document for Android

r? ``@joshtriplett``

21 months agoPut back one of the `use`s for intra-doc mentions
Scott McMurray [Fri, 23 Sep 2022 07:02:49 +0000 (00:02 -0700)]
Put back one of the `use`s for intra-doc mentions

21 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
```

21 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

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

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

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

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

21 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

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

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

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

21 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

21 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

21 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

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

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

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

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

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

21 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

21 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

21 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

21 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

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

21 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

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

21 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. :)

21 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

21 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``

21 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``

21 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

21 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`.

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

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