Skip to content

Rollup of 9 pull requests#157610

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

Rollup of 9 pull requests#157610
JonathanBrouwer wants to merge 26 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-atfsFrI

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@JonathanBrouwer JonathanBrouwer commented Jun 8, 2026

Successful merges:

r? @ghost

Create a similar rollup

GuillaumeGomez and others added 26 commits June 7, 2026 00:38
…nce Option

calling `.cloned()` or `.copied()` on `Option<T>` where `T` is an owned type
emitted "`Option<T>` is not an iterator" with a suggestion to prepend
`.into_iter()`. the suggested code still did not compile: `Option<T>::into_iter()`
yields `T` by value not `&T`, so `.cloned()`/`.copied()` failed again for the
same reason.

`Option<T>` implements `IntoIterator`, which is why the
`impl_into_iterator_should_be_iterator` branch fires. added a guard before it:
when the method is `cloned`/`copied`, the receiver is `Option<T>`, and `T` is a
concrete non-reference type, emit a targeted label pointing at the correct form
(`Option<&T>`) and suggest removing the call instead.
Inconsistency happens when subdiagnostic pads the main diagnostic with
an empty source line (aka "|"). Meanwhile the parallel frontend might
bunch subdiagnostics on a single primary diagnostic, removing padding
from some other one.

Revert "Update reproducibly failing tests when parallel frontend is enabled"

This reverts commit f582193.

Apply a test directive format suggested by a reviewer

Bless thine tests
Co-authored-by: Taiki Endo <te316e89@gmail.com>
Co-authored-by: Kerry Jones <kerry@iodrive.co.za>
asm! support for the Xtensa architecture

This implements the asm! support for Xtensa. We've been using this code for a few years in [our fork](https://github.com/esp-rs/rust) and it's been working well. I finally found some time to clean it up a bit and start the upstreaming process. This should be one of the final PRs for Xtensa support on the Rust side (minus bug fixes of course). After this, we're mostly just waiting on the LLVM upstreaming which is going well. This PR doesn't cover all possible asm options for Xtensa, but the base ISA plus a few extras that are used in Espressif chips.

r? Amanieu
Add very basic "comptime" fn implementation

Implements functions that cannot be called at runtime (and thus also not from normal const functions, as those could be called from runtime).

This is done via the internal attribute `rustc_comptime` that can be added to normal functions, turning them into compile-time-only functions.

Because @fee1-dead and @compiler-errors did amazing work, we even get trait bounds that work inside comptime fns: via unconditionally-const `const Trait` bounds.

Use cases are

* rust-lang#146923
* const heap intrinsics
* and the other various intrinsics (e.g. size_of 😆) that will just ICE in codegen or panic at runtime if they actually end up in runtime code

project goal issue: rust-lang/rust-project-goals#406

no tracking issue until we have a feature gate and some sort of syntax

cc @scottmcm as the T-lang goal champion
…cs-in-tests, r=petrochenkov

Fix unstable diagnostics in tests

The main inconsistency in changed tests happens when subdiagnostic pads the main diagnostic with an empty source line (aka "|"). Meanwhile the parallel frontend might bunch subdiagnostics on a single primary diagnostic, removing padding from some other one. So we can just ignore "|" lines.

Updates rust-lang#154314
Reverts rust-lang#157103
…acro_API, r=Mark-Simulacrum

Add `_value` API for number literals in proc-macro

Part of rust-lang#136652.

This PR adds the `*_value` for numbers (integers and floats). However, `f16` and `f128` are voluntarily left out as they're still unstable. Adding support for them is just a matter of uncommenting two lines, so should be fine.

Setting same reviewer as last time.

r? @Urgau
…diagnostic, r=folkertdev

fix: don't suggest .into_iter() for .cloned()/.copied() on non-reference Option

calling `.cloned()` or `.copied()` on `Option<T>` where `T` is an owned type emitted "`Option<T>` is not an iterator" with a suggestion to prepend `.into_iter()`. the suggested code still did not compile: `Option<T>::into_iter()` yields `T` by value not `&T` so `.cloned()`/`.copied()` failed again for the same reason.

`Option<T>` implements `IntoIterator` which is why the `impl_into_iterator_should_be_iterator` branch fires. added a guard before it: when the method is `cloned`/`copied`, the receiver is `Option<T>` and `T` is a concrete non-reference type. emit a targeted label pointing at the correct form (`Option<&T>`) and suggest removing the call instead.

closes rust-lang#151147
…=Nadrieril

Fix diagnostics for non-exhaustive destructuring assignments (rust-lang#157553)

Assigning to a refutable pattern (e.g. `Foo::One = Foo::One;`) is a destructuring assignment, which is lowered to a `let` binding. When the pattern was refutable, the refutability check reported it as a `let` binding. This detects the `AssignDesugar` origin during match checking and reports it as an assignment instead, dropping the `let`-specific note and suggestion.

Fixes rust-lang#157553.
explain that the size_of constant also serves to avoid optimizing away 'unused' size_of calls

During a discussion at the all-hands I got worried that we might do uncanny optimizations on code like this which would lead to that code actually compiling
```rust
#![crate_type = "lib"]

#[unsafe(no_mangle)] // ensure this gets monomorphized
pub fn f() {
    assert_valid_type::<[u32; 1 << 62]>();
}

pub fn assert_valid_type<T>() {
    std::mem::size_of::<T>();
}
```

We do something like that for [even more cursed similar code](https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=41b84c5e705c9d86a05a919e2135e2d3).
But turns out that for `size_of`, we are good! Ever since that was made a constant, the required_consts system ensures that we do indeed evaluate the constant even if we do not use its results.

r? @oli-obk
…st, r=JonathanBrouwer

test: remove ineffective link-extern-crate-with-drop-type test

Closes rust-lang#157477

Removed `tests/ui/cross-crate/link-extern-crate-with-drop-type.rs` and its auxiliary file. As discussed in the issue, this test was meant for language-level "resources" which were removed from Rust long ago, making the current test ineffective.

Verified locally that the remaining tests in `tests/ui/cross-crate` pass successfully.
…-path, r=mu001999

rustdoc: Remove unnecessary fast path

I added this "fast path" prematurely in PR rust-lang#116882.
It's not actually necessary as this perf run shows: rust-lang#146483 (comment) (https://perf.rust-lang.org/compare.html?start=40ace17fc3891155bad26a50d60a9ab07b83bf8e&end=a77816d56c8fdadab64ae3f9fe1a653bfdb975a8&stat=instructions:u).

Let's remove it since makes it slightly more annoying to add new reprs (one would need to update two places).
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 8, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. labels Jun 8, 2026
@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc 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 Jun 8, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never 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,x86_64-mingw-1,i686-msvc-2

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 8, 2026

📌 Commit 5ece1be 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 Jun 8, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 8, 2026

⌛ Trying commit 5ece1be with merge 050062c

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

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

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
Rollup of 9 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
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@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 Jun 8, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 8, 2026

This pull request was unapproved due to being closed.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors try cancel

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 8, 2026

Try build cancelled. Cancelled workflows:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

10 participants