Skip to content

Rollup of 11 pull requests - #161875

Closed
JonathanBrouwer wants to merge 26 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-jDGOOBv
Closed

Rollup of 11 pull requests#161875
JonathanBrouwer wants to merge 26 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-jDGOOBv

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

mehdiakiki and others added 26 commits August 24, 2026 19:31
... and related machienery
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.
Implement clamp_to

Implements the revised version of rust-lang#147781. Supersedes rust-lang#147786.

Currently I restrict the ClampBounds trait using a second, perma-unstable feature. I don't know if that's the usual way to deal with this kind of traits, I'd be happy to change it if not.

~~I currently define NaN as equal to no bound. This is consistent with `max` and `min`, but is inconsistent with `clamp`, which panics.~~

Changed so that the float versions panic if any bound is NaN, just like `clamp` does.
std: avoid aliasing violations when wrapping opaque C types

Fixes rust-lang#160815 (and some other instances of the same problem)

See the new documentation of `COpaque` for a detailed description of the kinds of issues solved by this. In short: creating mutable references to the opaque types from pthread is unsound since some platforms (at least AIX) store an intrinsically list of these types and the creation of the mutable reference (e.g. in the drop glue) invalidates the other pointers to the type.

This doesn't just apply to the internal pthread `Condvar` and `Mutex` abstraction as described in the issue, but also to all other opaque types – nobody is promising us that these are not internally aliased. Hence this PR adds an internal `COpaque` helper type which uses a combination of `UnsafePinned` and `MaybeUninit` to relax all relevant requirements added by Rust's operational semantics.

CC @RalfJung I'd love to hear your opinion on this
r? libs
…ort-trait-lint, r=petrochenkov

Prefer ambiguous candidates when deduplicating traits in scope, so `ambiguous_glob_imported_traits` doesn't depend on import order

Fixes rust-lang#160742

When inserting candidates for a method pick we deduplicate candidates based on the trait id, this "deleted" traits that where (not) ambiguous:
```rust
// depending on the order, the second one is removed
mod prelude {
    pub use crate::expression::IntoSql;
    pub use crate::expression::IntoSql as _;
}

use module::*; // imports some item names IntoSql
use prelude::*; // imports trait `IntoSql` and `IntoSql as _`
```

This caused the lint `ambiguous_glob_imported_traits` to not be triggered if the `as _` came first, even though both are actually in scope.

We now deduplicate based on `(def_id, lint_ambiguous)` and later check that if an ambiguous candidate is present in `collapse_candidates_to_trait_pick`, we mark the pick as `lint_ambiguous`. (its also easy to reverse the behaviour of this change).

Also added a test with 2 revisions placing the `as _` export first or last.

It's the most "clean" way I could come up, hopefully someone more versed in this part of the compiler could tell me how it is done in a better way :).

cc @petrochenkov, since I feel like you know if the lint should be triggered or not in this case.

LLM disclosure: I used a LLM to create a shorter PR title, because i couldn't come up with a short one.
…ustom_section, r=alexcrichton

Put data segment in specified section with link_section on wasm

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.

Fixes rust-lang#146538

r? alexcrichton
…ault-functions, r=petrochenkov

delegation: add tests fixating behavior of delegating to default trait implementations

This PR adds tests for delegation to trait functions that have default implementation, thus fixating current behavior.

Part of rust-lang#118212.
r? @petrochenkov
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
Allow Unpin impls for local extern type

Fixes rust-lang#155053

`visit_implementation_of_unpin` helper only handles `ty::Adt` and does delay the bug for everything else. The orphan check is what allows a local foreign type i.e. `ty::Foreign` and that's why we can each that arm and ICE.

Discloure: Only the test comments were genarated using an LLM.
…-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
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.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 27, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-unix Operating system: Unix-like labels Aug 27, 2026
@rustbot rustbot added 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-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. labels Aug 27, 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 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 37ba63a 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 27, 2026
@rust-bors

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit 37ba63a with merge ae7f582

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

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

rust-bors Bot pushed a commit that referenced this pull request Aug 27, 2026
Rollup of 11 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
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-21-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [crashes] tests/crashes/154963.rs ... ok
test [crashes] tests/crashes/154964.rs ... ok
test [crashes] tests/crashes/156101.rs ... ok
test [crashes] tests/crashes/155761-1.rs ... ok
2026-08-27T16:26:31.722156Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/156288.rs ... ok
test [crashes] tests/crashes/155053.rs ... FAILED
test [crashes] tests/crashes/160553.rs ... ok
test [crashes] tests/crashes/34127.rs ... ok
test [crashes] tests/crashes/87577.rs ... ok
---
failures:

---- [crashes] tests/crashes/155053.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/155053.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:16:18:
fatal error
stack backtrace:
   5: __rustc::rust_begin_unwind

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [crashes] tests/crashes/156101.rs ... ok
test [crashes] tests/crashes/154964.rs ... ok
test [crashes] tests/crashes/155761-1.rs ... ok
test [crashes] tests/crashes/156288.rs ... ok
2026-08-27T16:35:28.669597Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/155053.rs ... FAILED
test [crashes] tests/crashes/160553.rs ... ok
test [crashes] tests/crashes/87577.rs ... ok
test [crashes] tests/crashes/88296.rs ... ok
test [crashes] tests/crashes/34127.rs ... ok
---
failures:

---- [crashes] tests/crashes/155053.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/155053.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:16:18:
fatal error
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- [crashes] tests/crashes/155053.rs stdout end ----

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 27, 2026
@rust-bors

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

PR #161692, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 27, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors try cancel

@rust-bors

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

Hint: if you want to run another try build, you do not need to manually cancel the previous one. Just run @bors try and bors will cancel the previous build automatically.

@JonathanBrouwer
JonathanBrouwer deleted the rollup-jDGOOBv branch August 27, 2026 19:18
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. O-unix Operating system: Unix-like rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.