Skip to content

Rollup of 13 pull requests - #162251

Closed
JonathanBrouwer wants to merge 37 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-YwIaoiM
Closed

Rollup of 13 pull requests#162251
JonathanBrouwer wants to merge 37 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-YwIaoiM

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

folkertdev and others added 30 commits August 20, 2026 23:06
Commit bd174e1 ("Implement clamp_to") added a few float methods that
are not marked `#[inline]`. This causes `core` to require new symbols
in soft-float builds, even if the methods are unused, e.g. from the
Linux kernel:

    ld.lld: error: undefined symbol: fmaximum_numf
    >>> referenced by core.1f440ee8661e09f9-cgu.0
    >>>               rust/core.o:(<core::ops::range::RangeFrom<f32> as core::cmp::clamp::ClampBounds<f32>>::clamp) in archive vmlinux.a

(and similar for `f{min,max}imum_num{f,}` and `__gt{s,d}f2`).

It is possible to work around this in the Linux side, but these methods
should probably be `#[inline]` to begin with, like many other similar
methods are.

Thus mark them as inline.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
And only include the target name when rendering test metadata, to avoid including filenames in it.
…hecked_math.rs

Otherwise e.g. `@unchecked_add_unsigned` and `@unchecked_add_signed` get
merged after llvm/llvm-project#220015, breaking
the test's expectations.
Get the NT path then search for a drive that links to a prefix of it.
implement `Add` and `Sub` for `Complex`

tracking issue: rust-lang#154023

Adds the `Add` and `Sub` implementations described in the tracking issue. Some notes

- I also added a derive for `Eq`, which is useful for `Complex<{integer}>`
- The versions that add/sub by a scalar need a `Copy` bound. That seems fine for most actual use cases.

Apparently `num_complex` will `Clone` in these operations https://docs.rs/num-complex/latest/num_complex/struct.Complex.html#impl-Add%3CT%3E-for-%26Complex%3CT%3E, but that seems unlike `core` to me. Anyhow, libs can re-litigate that later.
…re-arm, r=davidtwco

make target feature ABI check a hard error on ARM

With LLVM 24, we now (finally) get hard errors from the backend for "you want ABI X but the target features required for that ABI are missing", at least on the ARM backend:
```
error: <unknown>:0:0: in function _RNvXsc_Cs4Af2OiBEA1T_8minicoreiNtB5_3Add3add i32 (i32, i32): calling convention is hard-float, but floating-point registers are unavailable
```
That's not a pretty error, so let's make rust emit a hard error before we even get there -- just on ARM for now, matching LLVM. We have emitted a future-compat error for this since Rust 1.86 (rust-lang#136147, rust-lang#134794). I'm not making it a hard error everywhere since for other targets we are still figuring out the exact things we have to check, and it's better to do that without risking new hard errors.

For ARM, the exact check we are doing is:
- every target must set `llvm_floatabi` to either "soft" or "hard"
- on softfloat targets, no check is needed
- on hardfloat targets, the "fpregs" target feature is *required* and the the "soft-float" target feature is *forbidden*

Since this is a new hard error, this probably requires FCP. I am not sure for which team -- @rust-lang/lang is often involved for target feature things, but this is mostly about rejecting invalid `-C` flags which are handled by t-compiler (@davidtwco @BoxyUwU).

Fixes rust-lang#161276
Tracking issue rust-lang#116344
Cc @TimNN
Add custom allocator support to `(try_)map` on `UniqueArc` and `UniqueRc`

Follow-up to rust-lang#161617.

This one required me to add allocator support to a lot more methods.
Probably good for them to have it for future additions ^^

The old, allocator-free methods went unused from this change and I had to remove them because we don't allow warnings (they are trivial to implement on top of the allocator ones). This had the side effect of making the diff a bit weird. Sorry!

r? nia-e
…closure-debug, r=spastorino

fix[154166]: closure debug capture print

Found and remove the `// FIXME(project-rfc-2229#48)` [see](rust-lang/rfcs#2229) in `mir/pretty.rs` used to Debug print mir.

Fix was to replace the old `tcx.upvars_mentioned` with `tcx.closure_captures`.
Added a test to check for printing of both in 2018 and 2021
… r=clarfonthey

Windows: add fallback if `canonicalize` fails

This attempts a partial workaround for issues such as: rust-lang#59392, rust-lang#79449, rust-lang#59107, rust-lang#54875, rust-lang#52440, rust-lang#52377, rust-lang#48249, rust-lang#74327, rust-lang#55812

This may require a bit of explanation depending on how familiar you are with Windows paths, I'll try to keep it brief. The short version is that the above issues are cases where third party devices don't integrate with the system sufficiently so Windows isn't aware of the canonical drive for a particular path, causing our `canonicalize` function to fail. This PR works around it by manually search for the drive letter that corresponds to the root of the path. This only works in cases where there is a drive letter assigned but that is the majority of cases. It won't work when the device is only mounted to a directory in another filesystem or isn't mounted at all.

To explain the implementation of this PR you should be aware that Windows on Windows NT is more like WINE on Linux then many people realise. You have a kernel (NT) and then you have an implementation of the Win32 APIs on top (this is why `kernel32.dll` is nothing to do with the real kernel, it's like an implementation of Win95's kernel API on top of another OS).  Admittedly the boundaries have become fuzzier over the years but there still remains a clear distinction between the Win32 API and the NT kernel API in many places.

Paths are one place where this distinction is made clear. You have the familiar Win32 paths like `C:\path\to\file` that date back to the time of DOS. And then you have the low-level NT kernel paths that look like `\Device\HarddiskVolume6\path\to\file` (which aren't really meant to be user-visible). To bridge the gap, the NT namespace has a special `??` directory containing mappings (i.e. symlinks) from drives like `C:` to paths like `\Device\HarddiskVolume6`. In that way translating between Win32 and NT paths is made simpler as you can replace `C:` with `\??\C:` and it'll get resolved to the right path and vice versa (the actual translation from win32 to NT is more complicated but I've already spent too many words on this).

So back to canonicalisation. Resolving the canonical NT path should always succeed. The problem comes when mapping that to a Win32 drive path. When the drive is managed by the system then when resolving paths it knows which drive to pick. However, if the drive mapping is added manually then it doesn't.

So the way to workaround this is to manually look at the drive mappings and see which one is the root of the NT path we have.
fix supposedly unreachable `bug!` being reachable

`bug!` introduced in rust-lang#161929

fixes rust-lang#162146

wfcheck.rs does a normalize on a type here https://github.com/rust-lang/rust/blob/edc52f87c28f328c61685a02c47887a5cec7d767/compiler/rustc_hir_analysis/src/check/wfcheck.rs#L929 which reduces the contained alias within from a nonrigid InherentSelf to a rigid InherentImpl, because we do so upon encountering a too-generic-to-ctfe alias

the very next line, it then `register_wf_obligation` on the resulting normalized type, that contains an InherentImpl

inside wf, that eventually hits the `bug!` I added and ICEs https://github.com/rust-lang/rust/blob/a4330234a776684c36428d001721d0320d24dd77/compiler/rustc_trait_selection/src/traits/wf.rs#L1104

r? @BoxyUwU
remove outdated next-solver handling

see inline comments
core: mark float `ClampBounds` methods as `#[inline]`

Commit bd174e1 ("Implement clamp_to") added a few float methods that are not marked `#[inline]`. This causes `core` to require new symbols in soft-float builds, even if the methods are unused, e.g. from the Linux kernel:

    ld.lld: error: undefined symbol: fmaximum_numf
    >>> referenced by core.1f440ee8661e09f9-cgu.0
    >>>               rust/core.o:(<core::ops::range::RangeFrom<f32> as core::cmp::clamp::ClampBounds<f32>>::clamp) in archive vmlinux.a

(and similar for `f{min,max}imum_num{f,}` and `__gt{s,d}f2`).

It is possible to work around this in the Linux side, but these methods should probably be `#[inline]` to begin with, like many other similar methods are.

Thus mark them as inline.
…ds, r=jhpratt

docs(time): clarify exact seconds for week and day

Documented that `Duration::from_weeks` defines one week as 604,800 seconds (7 days), and `Duration::from_days` defines one day as 86,400 seconds (24 hours).

Doctests for these methods also appear to be based on these definitions.

The purpose of this is to clarify that `Duration` is a fixed length value that ignores factors such as DST or a leap second.

This is inspired by <rust-lang/libs-team#869 (comment)>.

See also rust-lang#120301

@rustbot label +A-docs
…conds, r=jhpratt

docs(time): clarify exact seconds for hour and minute

Documented that `Duration::from_hours` defines one hour as 3,600 seconds (60 minutes), and `Duration::from_mins` defines one minute as 60 seconds.

Doctests for these methods also appear to be based on these definitions.

The purpose of this is to clarify that `Duration` is a fixed length value that ignores factors such as a leap second.

This is inspired by <rust-lang/libs-team#869 (comment)>.

It seems that no library in Rust handle leap seconds, so there isn't much point in documenting this. However, I don't think it would hurt to include it for the sake of consistency with rust-lang#162195.

See also rust-lang#120301

@rustbot label +A-docs
…ercote

coverage: Small cleanups in `extract_hir_info`

Two small improvements that I noticed while contemplating follow-ups to rust-lang#161517.

- Using a recursive call to modify function arguments is cute but confusing.
- Using a single deeply-nested pattern ends up being less readable than a multi-step let-chain.

There should be no change to compiler output.
Pass -Z merge-functions=disabled in tests/codegen-llvm/intrinsics/unchecked_math.rs

Otherwise e.g. `@unchecked_add_unsigned` and `@unchecked_add_signed` get merged after llvm/llvm-project#220015, breaking the test's expectations.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 3, 2026
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows 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 Sep 3, 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 Sep 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1317a1f 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 Sep 3, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 3, 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-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 test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

##[endgroup]
[TIMING:end] test::Compiletest { test_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1, mode: ui, suite: "ui", path: "tests/ui", compare_mode: None } -- 502.025
[TIMING:end] test::Ui { test_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1 } -- 0.000
[TIMING:start] synthetic_targets::SyntheticTargetWithPanicStrategy { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, base: wasm32-wasip1, strategy: Unwind }
[TIMING:end] synthetic_targets::SyntheticTargetWithPanicStrategy { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, base: wasm32-wasip1, strategy: Unwind } -- 0.000
[TIMING:start] test::MirOpt { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1 }
[TIMING:start] test::Compiletest { test_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1, mode: mir-opt, suite: "mir-opt", path: "tests/mir-opt", compare_mode: None }
[TIMING:start] compile::Std { target: x86_64-unknown-linux-gnu, build_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true }
Uplifting library (stage1 -> stage2)
[TIMING:end] compile::Std { target: x86_64-unknown-linux-gnu, build_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true } -- 0.000
---

##[endgroup]
[TIMING:end] test::Compiletest { test_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1, mode: mir-opt, suite: "mir-opt", path: "tests/mir-opt", compare_mode: None } -- 6.325
[TIMING:end] test::MirOpt { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1 } -- 0.000
[TIMING:start] test::MirOpt { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) }
[TIMING:start] test::Compiletest { test_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json), mode: mir-opt, suite: "mir-opt", path: "tests/mir-opt", compare_mode: None }
[TIMING:start] compile::Std { target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true }
[TIMING:start] compile::StartupObjects { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) }
[TIMING:end] compile::StartupObjects { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) } -- 0.000
[TIMING:start] compile::Std { target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false }
[TIMING:start] compile::StartupObjects { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) }
[TIMING:end] compile::StartupObjects { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) } -- 0.000
[TIMING:start] builder::Libdir { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) }
[TIMING:end] builder::Libdir { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) } -- 0.000

thread 'main' (1398) panicked at src/bootstrap/src/core/build_steps/compile.rs:329:13:
src.symlink_metadata() failed with No such file or directory (os error 2) ("src = /wasi-sdk-34.0-x86_64-linux/share/wasi-sysroot/lib/wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json)/libc.a")
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/std/src/panicking.rs:679:5
   1: core::panicking::panic_fmt
             at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/panicking.rs:80:14
---
   4: bootstrap::core::build_steps::compile::copy_and_stamp
             at /checkout/src/bootstrap/src/core/build_steps/compile.rs:329:13
   5: bootstrap::core::build_steps::compile::copy_self_contained_objects
             at /checkout/src/bootstrap/src/core/build_steps/compile.rs:452:13
   6: <bootstrap::core::build_steps::compile::Std>::copy_extra_objects
             at /checkout/src/bootstrap/src/core/build_steps/compile.rs:99:25
   7: <bootstrap::core::build_steps::compile::Std as bootstrap::core::builder::CommandLineStep>::run
             at /checkout/src/bootstrap/src/core/build_steps/compile.rs:245:33
   8: <bootstrap::core::build_steps::compile::Std as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:134:9
---
  18: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::MirOpt>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1637:36
  19: <bootstrap::core::build_steps::test::MirOpt as bootstrap::core::builder::CommandLineStep>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2280:25
  20: <bootstrap::core::builder::CommandLineStepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:470:13
  21: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:138:19
  22: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1173:9
---
  27: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Bootstrap has panicked, currently active steps:
test::MirOpt { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json) } at src/bootstrap/src/core/build_steps/test.rs:2280
test::Compiletest { test_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json), mode: mir-opt, suite: "mir-opt", path: "tests/mir-opt", compare_mode: None } at src/bootstrap/src/core/build_steps/test.rs:2285
compile::Std { target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true } at src/bootstrap/src/core/build_steps/test.rs:2430
compile::Std { target: wasm32-wasip1-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/wasm32-wasip1-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false } at src/bootstrap/src/core/build_steps/compile.rs:221
Panic was initiated from src/bootstrap/src/core/build_steps/compile.rs:329:13
Build completed unsuccessfully in 0:53:31
  local time: Thu Sep  3 17:52:07 UTC 2026
  network time: Thu, 03 Sep 2026 17:52:07 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

@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 Sep 3, 2026
@rust-bors

rust-bors Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR #160200, 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 Sep 3, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 3, 2026
@rust-bors

rust-bors Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 8872f22 failed: CI. Failed jobs:

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

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows 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-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.