Skip to content

Conversation

@github-actions
Copy link

This is an automated PR to update the subtree/library branch to the changes from 2025-09-09 (rust-lang/rust@9c27f27) to 2025-11-20 (rust-lang/rust@07bdbae), inclusive.
Review this PR as usual, but do not merge this PR using the GitHub web interface. Instead, once it is approved, use git push to literally push the changes to subtree/library without any rebase or merge.

madhav-madhusoodanan and others added 30 commits October 26, 2025 17:51
to char 2. including variable names in template strings instead of
passing them as arguments to macros
perf: removed unnecessary let for return only in layout.rs

perf: removed unnecessary let for return only
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 292be5c
Filtered ref: b038f5909ebeb7c0d597ae6e081f3ca4699d9643
Upstream diff: rust-lang/rust@27050c0...292be5c

This merge was created using https://github.com/rust-lang/josh-sync.
…ssociated, r=dtolnay

Turn `Cow::is_borrowed,is_owned` into associated functions.

This is done because `Cow` implements `Deref`. Therefore, to avoid conflicts with an inner type having a method of the same name, we use an associated method, like `Box::into_raw`.

Tracking issue: rust-lang#65143
…p-constants

`intrinsic-test`: dedup constants
rustc assumes that regular `extern "Rust"` functions unwind only if the
`unwind` panic runtime is linked. `throw` was annotated as such, but
unwound unconditionally. This could cause UB when a crate built with `-C
panic=abort` called `throw` from `core` built with `-C panic=unwind`,
since no terminator was added to handle the panic arising from calling an
allegedly non-unwinding `extern "Rust"` function.

rustc was taught to recognize this condition since
rust-lang#144225 and prevented such
linkage, but this caused regressions in
rust-lang#148246, since this meant that
Emscripten projects could not be built with `-C panic=abort` without
recompiling std.

The most straightforward solution would be to move `throw` into the
`panic_unwind` crate, so that it's only compiled if the panic runtime is
guaranteed to be `unwind`, but this is messy due to our architecture.
Instead, move it into `unwind::wasm`, which is only compiled for
bare-metal targets that default to `panic = "abort"`, rendering the
issue moot.
…r=bjorn3

Move wasm `throw` intrinsic back to `unwind`

Fixes rust-lang#148246, less invasive than the previously proposed rust-lang#148269. Removes the publicly visible unstable intrinsic tracked in rust-lang#122465 since it's not clear how to export it in a sound manner.

r? `@bjorn3`

---

rustc assumes that regular `extern "Rust"` functions unwind only if the `unwind` panic runtime is linked. `throw` was annotated as such, but unwound unconditionally. This could cause UB when a crate built with `-C panic=abort` called `throw` from `core` built with `-C panic=unwind`, since no terminator was added to handle the panic arising from calling an allegedly non-unwinding `extern "Rust"` function.

rustc was taught to recognize this condition since rust-lang#144225 and prevented such linkage, but this caused regressions in
rust-lang#148246, since this meant that Emscripten projects could not be built with `-C panic=abort` without recompiling std.

The most straightforward solution would be to move `throw` into the `panic_unwind` crate, so that it's only compiled if the panic runtime is guaranteed to be `unwind`, but this is messy due to our architecture. Instead, move it into `unwind::wasm`, which is only compiled for bare-metal targets that default to `panic = "abort"`, rendering the issue moot.
Signed-off-by: tison <wander4096@gmail.com>
Instead of `include_str!()`ing `range_search.rs`, just make it a normal
module under `core::unicode`. This means the same source code doesn't
have to be checked in twice, and it plays nicer with IDEs.

Also rename it to `rt` since it includes functions for searching the
bitsets and case conversion tables as well as the range
represesentation.
matthiaskrgr and others added 30 commits November 16, 2025 20:40
add must_use to extract_if methods

Also, mention the `.for_each(drop)` pattern in the documentation. One can't always use `retain` with a negated predicate as that does not have a range argument.

r? `@the8472`
…ulacrum

use funnel shift as fallback impl for rotating shifts

That lets us remove this gnarly implementation from Miri and const-eval.

However, `rotate_left`/`rotate_right` are stable as const fn, so to do this we have to `rustc_allow_const_fn_unstable` a bunch of const trait stuff. Is that a bad idea? Cc `@oli-obk` `@fee1-dead`
…r=scottmcm

Constify `ManuallyDrop::take`

Feature: `const_manually_drop_take`
Tracking issue: rust-lang#148773

This PR constifies `ManuallyDrop::take`.
add note to `lines` docs about empty str behavior

This pull request adds a short note to the documentation for `str::lines` that describes the behavior of the resulting iterator when called on an empty string. I tripped over this a few days ago because I thought (incorrectly) that the iterator would return a single line with an empty string. I don't doubt that the actual behavior (return no lines) is the correct behavior, but in the absence of explicit documentation describing it, I came to the wrong conclusion about it and maybe others will too. If this is so obvious as to be not worth including, I'm happy to withdraw the pull request! Thanks for taking a look.
Rollup of 11 pull requests

Successful merges:

 - rust-lang#148505 (add larger test for `proc_macro` `FromStr` implementations)
 - rust-lang#148752 (Constify `ManuallyDrop::take`)
 - rust-lang#148757 (Constify `mem::take`)
 - rust-lang#148855 (Error if an autodiff user does not set lto=fat)
 - rust-lang#148912 (add note to `lines` docs about empty str behavior)
 - rust-lang#148958 (Run codegen tests on a 32-bit target in PR CI)
 - rust-lang#148994 (Abi compatibility test cleanup)
 - rust-lang#148999 (Tweak Motor OS linker preset, fix `remote-test-server` for Motor OS)
 - rust-lang#149004 (compiletest: Avoid race condition in file deletion)
 - rust-lang#149008 (triagebot: remove jsha from notifications for rustdoc HTML)
 - rust-lang#149010 (compiletest: Remove the "wasm32-bare" alias for `wasm32-unknown-unknown`)

r? `@ghost`
`@rustbot` modify labels: rollup
Stabilize `char_max_len`

Tracking issue: rust-lang#121714

r? t-libs-api

`@rustbot` label +needs-fcp -T-libs +T-libs-api

Closes rust-lang#121714
Fix link in c_longlong documentation

Ran across this mistake when reading [the documentation](https://doc.rust-lang.org/std/ffi/type.c_longlong.html). I went through the other `.md` files in this directory and didn't spot any other errors.

**I did not check the output of this change** - I couldn't figure out how to get `cargo doc` to work and I figured it's not worth the distraction. It can't really go wrong, can it?
Attempt to "fix" two flaws of the current documentation:

1. The over-emphasis of fence - fence synchronization, relegating
   atomic - fence and fence - atomic synchronization to second fiddle.
2. The lack of explanation as to how to properly perform atomic - fence
   and fence - atomic synchronization.

It does so by first making it clear that there are 3 different ways to
use an atomic fence, then presenting a full example for each usecase,
noting the particular position of the fence with regard to the atomic
operation, and rounding up with generic notes.
…heemdev

std: move `kernel_copy` to `sys`

Part of rust-lang#117276.

The current organisation of the `kernel_copy` mechanism used to specialise `io::copy` on Linux necessitated circular links between the `io::copy` module and the implementation in `sys::pal::unix::kernel_copy`, as well as presenting an exception to the tidy PAL rule that forbids OS-based `#[cfg]`s outside of `sys` and `os`.

This PR fixes this by moving `kernel_copy` to `sys` (as per rust-lang#117276) and returning a `CopyState` from that function specifying whether `io::copy` should use its fallback. The `kernel_copy` function on other platforms just unconditionally returns `CopyState::Fallback`.
819247f changed <str as Debug>::fmt such that it does not escape single
quotes, but neglected to apply the same choice to OsString. This commit
does that.
- Implement std::fs::metadata function.
- Tested on qemu ovmf

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Replace OffsetOf by an actual sum of calls to intrinsic.

This PR changes the way we compute the value of the `offset_of!` macro in MIR. The current implementation uses a dedicated MIR rvalue.

This PR proposes to replace it by an inline constant which sums calls to a new intrinsic `offset_of(variant index, field index)`. The desugaring is done at THIR building time, easier that doing it on MIR.

The new intrinsic is only meant to be used by const-eval. LLVM codegen will refuse to generate code for it.

We replace:
```rust
a = offset_of!(T, Variant1.Field1.Variant2.Field2);
```

By:
```rust
a = const {constant#n};

{constant#n}: usize = {
    _1 = offset_of::<T>(index of Variant1, index of Field1);
    _2 = offset_of::<U>(index of Variant2, index of Field2); // Where T::Variant1::Field1 has type U
    _0 = _1 + _2
}
```

The second commit modifies intrinsic const checking to take `allow_internal_unstable` into account. The new intrinsic should only be called from stable `offset_of!` macro. The intrinsic itself is unstable, const-unstable, but `rustc_intrinsic_const_stable_indirect`.

Fixes rust-lang#123959
Fixes rust-lang#125680
Fixes rust-lang#129425
Fixes rust-lang#136175

r? `@ghost`
std: sys: fs: uefi: Implement stat

- Implement std::fs::metadata function.
- Tested on qemu ovmf
…llaumeGomez

Rollup of 4 pull requests

Successful merges:

 - rust-lang#148970 (std: sys: fs: uefi: Implement stat)
 - rust-lang#149020 (flush_delayed: add note about stashed diagnostics)
 - rust-lang#149026 (Add test for href of reexported enum variant)
 - rust-lang#149049 (compiletest: Use JSON "binary-format" to decide `//@ only-elf` and `//@ ignore-elf`)

r? `@ghost`
`@rustbot` modify labels: rollup
…ic-fence-doc-improvement, r=Mark-Simulacrum

Improve the documentation of atomic::fence

Attempt to "fix" two flaws of the current documentation:

1. The over-emphasis of fence - fence synchronization, relegating atomic - fence and fence - atomic synchronization to second fiddle.
2. The lack of explanation as to how to properly perform atomic - fence and fence - atomic synchronization.

It does so by first making it clear that there are 3 different ways to use an atomic fence, then presenting a full example for each usecase, noting the particular position of the fence with regard to the atomic operation, and rounding up with generic notes.
Return `NonZero<u32>` instead of `u32`.
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#147887 (Improve the documentation of atomic::fence)
 - rust-lang#148281 (repr(transparent) check: do not compute check_unsuited more than once)
 - rust-lang#148484 (Fix suggestion for the `cfg!` macro)
 - rust-lang#149057 (`rust-analyzer` subtree update)
 - rust-lang#149061 (debug-assert FixedSizeEncoding invariant)

r? `@ghost`
`@rustbot` modify labels: rollup
recommend using a HashMap if a HashSet's second generic parameter doesn't implement BuildHasher

closes rust-lang#147147

~The suggestion span is wrong, but I'm not sure how to find the right one.~ fixed

I'm relatively new to the diagnostics ecosystem, so I'm not sure if `span_help` is the right choice. `span_suggestion_*` might be better, but the output from `x test` looks weird in that case.
…adsmtm

Make SIMD intrinsics available in `const`-contexts

successor to rust-lang#146568, this PR actually makes the SIMD intrinsics `const`, and modifies the tests to test the const-eval implementations

r? `@tgross35` ig (although feel free to reassign, this is not anything targeted really)
…li-obk

Start documenting autodiff activities

Some initial documentation of the autodiff macros and usage examples
…bit-width, r=scottmcm

feat: Add `bit_width` for unsigned `NonZero<T>`

- Tracking issue: rust-lang#142326

This pull request adds a method to the unsigned `NonZero<T>` that return the minimum number of bits required to represent a value.

This can be achieved by using the `get` method and the methods added in rust-lang#142328, but I think adding the `NonZero::bit_width` method is useful because it accomplishes the same thing a little more succinctly.
Match <OsString as Debug>::fmt to that of str

Fixes rust-lang#114583.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.