Improve missing core error for tier 3 targets
Tier 3 targets can't be installed via rustup, so don't recommend that. Additionally, do recommend build-std on stable because it's the recommended way to use these targets, people should switch to nightly.
Document default SOCK_CLOEXEC flag on new UnixStream
Currently, the `std::os::unix::net::UnixStream` docs do not specify that the SOCK_CLOEXEC flag is set on new sockets. This commit adds a note clarifying that, in line with the note abuot the `MSG_NOSIGNAL` flag.
rustdoc: fix duplicate Re-exports sections
Fixesrust-lang/rust#150211
When a module contains both `pub extern crate` and `pub use` items, they were being rendered under two separate "Re-exports" section headers instead of one.
This fix tracks the current section and only renders a new header when the section actually changes, consolidating items that belong to the same section under a single header.
Don't use `matches!` when `==` suffices
In the codebase we sometimes use `matches!` for values that can actually just be compared. Replace them with `==`.
Subset of rust-lang/rust#149933.
Document relative and absolute paths handling in `--remap-path-prefix`
After what we have been through with https://github.com/rust-lang/rust/pull/150110 and https://github.com/rust-lang/rust/pull/150283 in the compiler, I think it would be good to document the user-facing parts of the relative and absolute paths handling in `--remap-path-prefix`.
r? `@jieyouxu`
Tier 3 targets can't be installed via rustup, so don't recommend that.
Additionally, do recommend build-std on stable because it's the
recommended way to use these targets, people should switch to nightly.
Add `MaybeDangling` to `core`
This is the library part of adding `MaybeDangling`. Note that it doesn't actually do anything described in its docs (yet), I'll make a separate PR for that.
Tracking issue: https://github.com/rust-lang/rust/issues/118166.
r? libs
cc `@RalfJung`
JumpThreading: compute place and value indices on-demand
Profiling JumpThreading reveals that a large part of the runtime happens constructing the place and value `Map`. This is unfortunate, as jump-threading may end up not even doing anything.
The cause for this large up-front cost is following: `Map` attempts to create a `PlaceIndex` for each place that *may* hold a relevant value. This means all places that appear in MIR, but also all places whose value is accessed by a projection of a copy of a larger place.
This PR refactors the creation of `Map` to happen on-demand: place and value indices are created when threading computation happens.
The up-front mode is still relevant for DataflowConstProp, so is not touched.
Fix copy code example with line numbers
Fixesrust-lang/rust#150339.
Since the line numbers are now included in the actual highlighted code, we need to filter them out when we "copy" the code.
r? `@yotamofek`
Currently, the `std::os::unix::net::UnixStream` docs do not specify that
the SOCK_CLOEXEC flag is set on new sockets. This commit adds a note
clarifying that, in line with the note abuot the `MSG_NOSIGNAL` flag.
- fixup `BTreeMap` gdb provider
- fixup `ManuallyDrop` natvis thingy
Now that `MaybeUninit` contains `ManuallyDrop` which contains
`MaybeDangling` (tbc this is the addition), we need to unwrap one more
layer.
Port `#[rustc_must_implement_one_of]` to attribute parser
Stumbled upon a weird (bug ?) behaviour while making this PR
it seems like it is possible to reach `check_attr.rs` checks without the attribute allowed target checks having already been finished, I added a comment about how to reproduce this in `check_attr.rs`
otherwise good to note is that a bunch of code was moved from `compiler/rustc_hir_analysis/src/collect.rs` to `check_attr.rs`
r? `@JonathanBrouwer`
compiler/middle/lint: Suggest `#[expect(dead_code)]` instead of `#[allow(dead_code)]`
Until now the compiler suggested
> help: to override `-W unused` add `#[allow(dead_code)]`
when encountering e.g. an unused function in the codebase.
This PR changes the suggestion to `#[expect(dead_code)]`, which will warn again once the code is being used somewhere. This is helpful because it lets the developer know that the attribute can now be removed again. Without this the codebase will eventually be littered with stray `#[allow(dead_code)]` attributes that are no longer serving any purpose.
This was suggested in https://bsky.app/profile/steveklabnik.com/post/3m2uh7pf6e225 and I agreed strongly enough to take a look and implement it 😆
Clippy subtree update
r? Manishearth
`Cargo.lock` update due to 28d62f0833. It should not affect the Rust repo, as `clippy_dev` is not used in the Rust repo.
Write file with channel to S3
This will let rustup-toolchain-install-master gain support for installing stable artifacts, which is currently only possible when explicitly overriding the channel. That in turn will unblock letting Crater kick off a beta run as soon as both a new beta and a new stable artifact are ready, rather than waiting until the actual release.
This resulted in the following error for me:
error[E0464]: multiple candidates for `rlib` dependency `rustc_literal_escaper` found
--> clippy_dev/src/lib.rs:25:1
|
25 | extern crate rustc_literal_escaper;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: candidate #1: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-4f30574e01c3dad1.rlib
= note: candidate #2: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-c8a0e29ad1040cee.rmeta
Other tools in the Rust repo also take that as an explicit dependency, like rust-analyzer or lint-docs.
When a module contains both `pub extern crate` and `pub use` items,
they were being rendered under two separate "Re-exports" section
headers instead of one. This happened because the code iterated over
each ItemType separately and rendered a section header for each,
even though both ExternCrate and Import map to the same ItemSection.
This fix tracks the current section and only renders a new header
when the section actually changes, consolidating items that belong
to the same section under a single header.