Skip to content

Rollup of 13 pull requests#157616

Merged
rust-bors[bot] merged 38 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-TC4GBP2
Jun 8, 2026
Merged

Rollup of 13 pull requests#157616
rust-bors[bot] merged 38 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-TC4GBP2

Conversation

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

orlp and others added 30 commits June 5, 2026 12:45
…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>
Seemingly on XFS only, the `AlreadyExists` variant is returned.

Reproducible on Linux hosts:

```rust
use clap::Parser;

struct Args {
    /// Destination to try
    #[arg()]
    path: std::path::PathBuf,
}

fn main() {
    let args = Args::parse();

    // Renaming a directory over a non-empty existing directory should fail.
    let tmpdir = std::path::Path::new(&args.path);
    std::fs::create_dir_all(tmpdir).unwrap();

    let source_path = tmpdir.join("source_directory");
    let target_path = tmpdir.join("target_directory");

    std::fs::create_dir(&source_path).unwrap();
    std::fs::create_dir(&target_path).unwrap();

    let target_path_file = target_path.join("target_file.txt");
    std::fs::write(target_path.join("target_file.txt"), b"target hello world").unwrap();
    println!("wrote {target_path_file:?}");

    println!("{source_path:?} -> {target_path:?}");
    let err = std::fs::rename(source_path, target_path).unwrap_err();
    assert_eq!(err.kind(), std::io::ErrorKind::DirectoryNotEmpty);
}
```

```bash
XFS_BLOCK=image-xfs
truncate -s 512M image-xfs
mkfs.xfs -q image-xfs
mkdir mnt-xfs
sudo mount -o loop image-xfs mnt-xfs
sudo chmod 777 mnt-xfs
cargo run -- mnt-xfs/
```

Output:

```
wrote "mnt-xfs/target_directory/target_file.txt"
"mnt-xfs/source_directory" -> "mnt-xfs/target_directory"

thread 'main' (267220) panicked at src/main.rs:30:5:
assertion `left == right` failed
  left: AlreadyExists
 right: DirectoryNotEmpty
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
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
Improve TLS codegen by marking the panic/init path as cold

This is an extension of the performance improvements seen from <rust-lang#141685>. I noticed that the non-`const` TLS still didn't have the `#[cold]` attribute for the uninit/panic path, and I also realized that neither implementation should have the initialization or panic path inlined, ever.

These paths are taken either only once per thread (`init`) or never (`panic`, in a well-behaving Rust program), thus they don't deserve to litter the code generated each time you access a thread-local variable. So in addition to `#[cold]` I added the more aggressive `#[inline(never)]` to both cold paths as well.
…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
@rustbot rustbot added 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

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit eb90e0a 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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
Rollup of 13 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

This comment has been minimized.

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 218c6df (218c6dfcd9b3bc7dc6b5a4192ae880919450b417, parent: 877a13169d4cc9f943ae776d84a5c80aa77e0096)

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. 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

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 16m 50s
Pushing cb46fbb to main...

@rust-bors rust-bors Bot merged commit cb46fbb into rust-lang:main Jun 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing f3ef3bd (parent) -> cb46fbb (this PR)

Test differences

Show 192 test diffs

Stage 1

  • [ui] tests/ui/comptime/const_comptime.rs: [missing] -> pass (J0)
  • [ui] tests/ui/comptime/feature-gate-test.rs: [missing] -> pass (J0)
  • [ui] tests/ui/comptime/not_callable.rs: [missing] -> pass (J0)
  • [ui] tests/ui/comptime/trait_bounds.rs: [missing] -> pass (J0)
  • [ui] tests/ui/comptime/trait_comptime.rs: [missing] -> pass (J0)
  • [ui] tests/ui/cross-crate/link-extern-crate-with-drop-type.rs: pass -> [missing] (J0)
  • [ui] tests/ui/destructuring-assignment/refutable-enum-assignment.rs: [missing] -> pass (J0)
  • [ui] tests/ui/layout/too-big-no-dce.rs: [missing] -> pass (J0)
  • [ui] tests/ui/methods/option-cloned-copied-non-ref-excluded.rs: [missing] -> pass (J0)
  • [ui] tests/ui/methods/option-cloned-copied-non-ref.rs: [missing] -> pass (J0)
  • [assembly] tests/assembly-llvm/asm/xtensa-types.rs: [missing] -> pass (J4)
  • [ui] tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs: [missing] -> pass (J4)
  • [assembly] tests/assembly-llvm/asm/xtensa-types.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J5)
  • [ui] tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J5)

Stage 2

  • [assembly] tests/assembly-llvm/asm/xtensa-types.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J1)
  • [ui] tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs: [missing] -> ignore (gcc backend is marked as ignore) (J2)
  • [ui] tests/ui/proc-macro/test.rs: pass -> ignore (gcc backend is marked as ignore) (J2)
  • [ui] tests/ui/comptime/const_comptime.rs: [missing] -> pass (J3)
  • [ui] tests/ui/comptime/feature-gate-test.rs: [missing] -> pass (J3)
  • [ui] tests/ui/comptime/not_callable.rs: [missing] -> pass (J3)
  • [ui] tests/ui/comptime/trait_bounds.rs: [missing] -> pass (J3)
  • [ui] tests/ui/comptime/trait_comptime.rs: [missing] -> pass (J3)
  • [ui] tests/ui/cross-crate/link-extern-crate-with-drop-type.rs: pass -> [missing] (J3)
  • [ui] tests/ui/destructuring-assignment/refutable-enum-assignment.rs: [missing] -> pass (J3)
  • [ui] tests/ui/layout/too-big-no-dce.rs: [missing] -> pass (J3)
  • [ui] tests/ui/methods/option-cloned-copied-non-ref-excluded.rs: [missing] -> pass (J3)
  • [ui] tests/ui/methods/option-cloned-copied-non-ref.rs: [missing] -> pass (J3)
  • [assembly] tests/assembly-llvm/asm/xtensa-types.rs: [missing] -> pass (J6)
  • [ui] tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs: [missing] -> pass (J7)
  • [ui] tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J8)

Additionally, 162 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard cb46fbb8c6ea799c6fba9188ed889275c35a8c28 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-powerpc64-linux-musl: 2h 7m -> 1h 15m (-41.3%)
  2. x86_64-gnu-llvm-22-1: 1h 13m -> 45m 45s (-38.1%)
  3. dist-aarch64-linux: 1h 50m -> 2h 32m (+37.6%)
  4. dist-loongarch64-linux: 2h 29m -> 1h 49m (-26.8%)
  5. x86_64-msvc-ext3: 1h 59m -> 1h 27m (-26.6%)
  6. dist-loongarch64-musl: 2h 22m -> 1h 45m (-25.7%)
  7. i686-gnu-nopt-2: 2h 26m -> 1h 48m (-25.6%)
  8. dist-powerpc64le-linux-gnu: 2h 13m -> 1h 39m (-25.3%)
  9. dist-powerpc64le-linux-musl: 2h 8m -> 1h 36m (-24.8%)
  10. dist-aarch64-apple: 1h 41m -> 2h 6m (+24.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#143511 Improve TLS codegen by marking the panic/init path as cold 6f652bccf0064dcdc88d6c205623d026ea512f8d (link)
#147302 asm! support for the Xtensa architecture 50d5c56c6472e9a4aae0d29ab1f87bd7e79a1e73 (link)
#148820 Add very basic "comptime" fn implementation 370b17224f8f42b014ed1ee915f1744bb13b0251 (link)
#154608 Add _value API for number literals in proc-macro 35f7c6913f645a7fd61555e2dcadc107ddde2d66 (link)
#156762 xfs support in `test_rename_directory_to_non_empty_director… c0b41579eab67deef71b44c68732e00261aa6a13 (link)
#157299 Fix unstable diagnostics in tests 90aca16ea40f266b67b7c31c7d182c0f86bb6bb7 (link)
#157300 Relax test requirements for consistency 8f2e596d9803c2c72d425f8de52ecb438e36bbef (link)
#157383 tests: codegen-llvm: Ignore BPF targets in c-variadic-opt 28ed6373797e1dc9363eb8488b5e1f2b23a4ba23 (link)
#157413 fix: don't suggest .into_iter() for .cloned()/.copied() on … 4b1b0746d3705dae62bdbd30544b8eab7e582a59 (link)
#157578 Fix diagnostics for non-exhaustive destructuring assignment… 224134239bec49b70403c56288178fab0e0b1932 (link)
#157587 explain that the size_of constant also serves to avoid opti… c788a5301e81f10f5fcbd24453092a535130fb2b (link)
#157596 test: remove ineffective link-extern-crate-with-drop-type t… a774f1b768ee469794ff1abfe1c7011f66870f1a (link)
#157602 rustdoc: Remove unnecessary fast path 6d7117b5a1bb24838dee95b7433fc42e5a66c95b (link)

previous master: f3ef3bd882

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (cb46fbb): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.3% [0.3%, 0.5%] 4
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 5
All ❌✅ (primary) -0.0% [-0.3%, 0.2%] 2

Max RSS (memory usage)

Results (primary -1.4%, secondary 2.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
6.2% [6.2%, 6.2%] 1
Improvements ✅
(primary)
-5.2% [-5.2%, -5.2%] 1
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) -1.4% [-5.2%, 2.4%] 2

Cycles

Results (secondary 2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.5%, 3.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary 1.2%, secondary 1.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.2% [0.0%, 1.9%] 11
Regressions ❌
(secondary)
1.8% [0.3%, 3.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [0.0%, 1.9%] 11

Bootstrap: 517.572s -> 517.707s (0.03%)
Artifact size: 400.85 MiB -> 400.82 MiB (-0.01%)

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 merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup 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.