Skip to content

Rollup of 21 pull requests - #161906

Open
JonathanBrouwer wants to merge 51 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-obMe707
Open

Rollup of 21 pull requests#161906
JonathanBrouwer wants to merge 51 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-obMe707

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

RalfJung and others added 30 commits August 17, 2026 11:30
... and related machienery
When annotating an item with `#[cfg]` we track both the item that got annotated (with an inert attr) and the names of items that got directly cfg'd out. Extend this mechanism to also work for items within a `cfg_select!`.
Remove trivial bounds

Panic on NaN

Make assert messages consistent with field names

Add clamp_to coretests

Update to fmt style

Use target_has_reliable_fN_math

Change existing clamp tests to use reliable_math

Use reliable_math on doctests too

Add #[expect] for NaN check
This is the normal behavior on other targets, but previously on wasm the
data segment would be in the default section and instead a custom
section with the given name would be added to the wasm module.
…, where the name is ambiguous, make to always

report the `ambiguous_glob_imported_traits` lint independent of the ordering of exports. Added a test to make sure both ordering trigger the lint.
This commit adds the `crt1-reactor.o` object file in the list of
pre-link-crt-objects for the `{Dynamic,Static}Dylib` output kinds for
WASI targets. These previously were omitted I believe by accident and
this means that the conventional `_initialize` function is not present
which runs constructor functions, for example. This is additionally
needed for the upcoming wasip3 target where this startup object file is
more load bearing than it was previously and will become required.
* Implement Reborrow as a recursive operation

If Reborrow finds '&'a mut T' fields then it inserts
a Deref and borrow of the T, and likewise if it finds a
'T: Reborrow' field then the field type is recursed into.

This makes Reborrow always produce the correct borrow checking logic at
the cost of most probably being inconsiderately expensive. The thinking
is that performance will be a followup consideration.
* PhantomDeref
* Simpler deref test

* Add more PhantomDeref unreachability assertions
* Write out lifetime omission
* Document ProjectionElem::PhantomDeref
* Comment half of reborrow tests
* fix PhantomDeref conflicting with AccessDepth::Shallow
* Recheck CoerceShared in borrowck TypeChecker to ensure its lifetimes make sense
* Fix rebase
* Changes... but where to?
* Typo fix

* Improve comment
* Use fully_perform_op to evaluate CoerceShared trait in borrowck
* More CoerceShared comment
* Comment rest of Reborrow tests

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
…ochenkov

reduce perf impact of scalar size checks

Attempting to undo the perf regression in rust-lang#161238.
…r=khyperia

Add regression test to ensure optimal compilation

closes rust-lang#81342
Print vendor instructions in `x vendor`

When the user manually runs `x vendor`, we should tell them what to put into their `.cargo/config.toml` file. This regressed some time ago when the Vendor step was refactored in bootstrap, I think.

Before this PR, the part after "this project" was blank:

```
To use vendored sources, add this to your .cargo/config.toml for this project:

[source.crates-io]
replace-with = "vendored-sources"

[source."git+https://github.com/rust-lang/team"]
git = "https://github.com/rust-lang/team"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
```

r? bjorn3
…-type-mismatch-attribution, r=folkertdev

Improve type mismatch annotation for lets with block-wrapped initializers

Fixes rust-lang#127048
…=JonathanBrouwer

Never type after-stabilization cleanup

r? @JonathanBrouwer
…peria

Do not optimize MIR for comptime ConstFns

Fixed rust-lang#161770: ICE when trying to run clippy on core, etc. Two small changes, both involve checking that optimized MIR is not requested for comptime functions.

First change is to Clippy, changed so impl LateLintPass for RedundantClone checks whether a function is optimizable or not (i.e., whether it is both a ConstFn && it is a runtime not a comptime function).

Second change is to the pretty print function write_mir_pretty in rustc_middle, which needs the same check to make sure it does not request optimization for comptime functions, even if they're ConstFn.

Can check for the original bug with the following bootstrap.toml:
profile = "compiler"
change-id = 160100
rust.deny-warnings = false

then run the following commands from 'rust' root:
``` shell
# first failure
RUSTFLAGS="--emit-mir" ./x.py clippy -- -Wclippy::redundant_clone

# second failure
rustc ./tests/ui/comptime/comptime_method_bounds.rs --emit=mir

# third failure
cd library/core
RUSTFLAGES="--emit=mir" cargo check
```

The first failure is fixed with just the change to impl<'tcx> LateLintPass for RedundantClone, while the second and third failures are fixed by the change to write_mir_pretty() which previously was trying to optimize MIR for comptime functions.
atomicptr.rs test: remove unused import
…pback, r=clarfonthey

bind to [::1] instead of 127.0.0.1 in documentation examples for v6 UDP methods

My first contribution towards rust-lang#161832

I think this is reasonable to do despite the ongoing discussion, as it's IPv6-specific methods and likely resulted from copy-pasting the code blocks.
…ms, r=Urgau

rustdoc: Correctly handle when a macro generates multiple items in `--generate-macro-expansion`

Fixes rust-lang#157508.

When a macro expands multiple items, they all have the exact same `Span`. So to prevent them from overwrite the previous one(s) sharing the same `Span`, we check this case too.

r? @Urgau
…sDenton

Add link to ownership section in ptr::read docs

This one has annoyed me for a while but I never found it worth fixing.

One of the safety requirements of `read` is that you handle ownership correctly.

All `read`-like functions in the `ptr` module (e.g. `copy`, `read_unaligned`) state that "just like `read`", you have to take care around this, and they link to the section on ownership in the `read` docs.
However, `read` does not do so in its own safety requirements, and worse yet, you have to *scroll down* to see the section.

Every so often I look at this function and think ownership is missing from the docs, before remembering this.
This PR just adds a link to make sure users don't miss this.

r? libs
…aumeGomez

rustdoc: some clarifying comments

I had to dig into rustdoc for [this recent adventure](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619633123) and learned some things that I found far from obvious from the code. Add some comments to make this easier for the next adventurer going down the same path.

r? @GuillaumeGomez
Mark `extern_item_impls` feature as incomplete

context: rust-lang#161873 (comment)

> If they are so unstable, maybe they should have a separate feature gate that's marked as `incomplete`. Or the entire `extern_item_impls` should be marked "incomplete".

I think it's just best to mark the entire thing as incomplete for now. Later, when the implementation matures we can consider removing the incompleteness or splitting the feature in unstable and incomplete parts.

r? @bjorn3 @RalfJung
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 28, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Aug 28, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple-1,aarch64-apple-2,x86_64-mingw-1,i686-msvc-1,i686-msvc-2

@rust-bors

rust-bors Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 17366b1 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 28, 2026
@rust-bors

rust-bors Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit 17366b1 with merge 16de974

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/33154698435

rust-bors Bot pushed a commit that referenced this pull request Aug 28, 2026
Rollup of 21 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple-1
try-job: aarch64-apple-2
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: i686-msvc-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs O-unix Operating system: Unix-like rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.