Remove useless doc_alias feature gate
As `@jyn514` rightfully noted in https://github.com/rust-lang/rust/pull/80686 , this feature is no more. Therefore, cleanup time!
r? `@jyn514`
I noticed that the Size::bits function is called in many places,
and is inlined into them. On x86_64-pc-windows-msvc, this function
is inlined 527 times, and compiled separately (non-inlined) 3 times.
Each of those inlined calls contains code that panics. This commit
moves the `panic!` call into a separate function and marks that
function with `#[cold]`.
This reduces binary size by 24 KB. By itself, that's not a substantial
reduction. However, changes like this often reduce pressure on
instruction-caches, since it reduces the amount of code that is inlined
into hot code paths. Or more precisely, it removes cold code from hot
cache lines. It also removes all conditionals from Size::bits(),
which is called in many places.
Add more code spans to docs in intrinsics.rs
I have added some more code spans in core/src/intrinsics.rs, changing some `=` to `==`, etc. I also changed the wording in some sections.
Rollup of 12 pull requests
Successful merges:
- #80442 (Mention Arc::make_mut and Rc::make_mut in the documentation of Cow)
- #80533 (bootstrap: clippy fixes)
- #80538 (Add check for `[T;N]`/`usize` mismatch in astconv)
- #80612 (Remove reverted change from relnotes)
- #80627 (Builder: Warn if test file does not exist)
- #80637 (Use Option::filter instead of open-coding it)
- #80643 (Move variable into the only branch where it is relevant)
- #80656 (Fixed documentation error for `std::hint::spin_loop`)
- #80666 (Fix missing link for "fully qualified syntax")
- #80672 (./x.py clippy: allow the most noisy lints)
- #80677 (doc -- list edit for consistency)
- #80696 (make sure that promoteds which fail to evaluate in dead const code behave correctly)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
make sure that promoteds which fail to evaluate in dead const code behave correctly
https://github.com/rust-lang/rust/pull/80243 showed that we'll have to live with these kinds of failing promoteds for a while, so let's make sure we have a test that covers them.
./x.py clippy: allow the most noisy lints
This silences the following clippy lints in ./x.py clippy:
many_single_char_names (there are a lot of warnings caused by stdarch)
collapsible_if (can reduce readability)
type_complexity
missing_safety_doc (there are almost 3K warnings issued)
too_many_arguments
needless_lifetimes (people want 'tcx lifetimes etc)
wrong_self_convention (warns about from_..(), to_..(), into_..().. fns that do or do not take self by reference.
Just for clarification; this only changes the output of `x.py clippy` inside the rustc repo and does not change anything about clippy or how `cargo clippy` is run on peoples crates.
Move variable into the only branch where it is relevant
At the `if` branch `filter` (the `let` binding) is `None` iff `filter` (the parameter) was `None`.
We can branch on the parameter, move the binding into the `if`, and the complexity of handling
`Option<Option<_>` largely dissolves.
`@rustbot` modify labels +C-cleanup +T-compiler
Note: I have no idea how hot this code is. If this method frequently gets called with a `None` filter, there might be a small perf improvement.
Builder: Warn if test file does not exist
Running `./x.py test` with a file that does not exists (but where the path belongs to a test suite) silently ignores the missing file and runs the whole test suite. This PR prints a warning to reduce the potential surprise factor.
Closes#80621
Add check for `[T;N]`/`usize` mismatch in astconv
Helps clarify the issue in #80506
by adding a specific check for mismatches between [T;N] and usize.
r? `@lcnr`
Don't use `self.date` unconditionally for `program_out_of_date()`
This avoids unnecessary cache invalidations for programs not affected by
the stage0 version (which is everything except the stage0 compiler
itself).
The redundant invalidations weren't noticed until now because they only
showed up on stage0 bumps, at which point people are used to rebuilding
everything anyway. I noticed it in https://github.com/rust-lang/rust/pull/79540
because I wasn't adding `self.date` to the stamp file (because I didn't realize it was necessary). Rather than
adding self.date I thought it was better to remove it from the cache key.
use PlaceRef more consistently instead of loosely coupled local+projection
Instead of working directly with the `projections` array, use `iter_projections` and `last_projection`. This avoids having to construct new `PlaceRef` from the pieces everywhere.
I only did this for a few files, to see how people think about this. If y'all are happy with this, I'll open an E-mentor issue to complete this. I grepped for `Place::ty_from` to find the places that need adjusting -- this could miss some, but I am not sure what else to grep for.
Add note to non-exhaustive match on reference to empty
Rust prints "type `&A` is non-empty" even is A is empty.
This is the intended behavior, but can be confusing.
This commit adds a note to non-exhaustive pattern errors if they are a
reference to something uninhabited.
I did not add tests to check that the note is not shown for
non-references or inhabited references, because this is already done
in other tests.
Maybe the added test is superfluous, because
`always-inhabited-union-ref` already checks for this case.
This does not handle &&Void or &&&void etc. I could add those as special
cases as well and ignore people who need quadruple
references.
Fixes#78123