Skip to content

Update subtree/library to 2026-06-01 - #659

Open
github-actions[bot] wants to merge 983 commits into
subtree/libraryfrom
update-subtree/library
Open

Update subtree/library to 2026-06-01#659
github-actions[bot] wants to merge 983 commits into
subtree/libraryfrom
update-subtree/library

Conversation

@github-actions

Copy link
Copy Markdown

This is an automated PR to update the subtree/library branch to the changes from 2025-11-25 (rust-lang/rust@c871d09) to 2026-06-01 (rust-lang/rust@14210df), 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.

RalfJung and others added 30 commits May 10, 2026 11:34
Revert "Change implementation of `vld1_dup`"
Remove the `transmute` heuristic from stdarch-gen-arm
Previously ::floor() included an example showing behaviour for
negative values, but ::ceil() did not. Ensure both have examples of
the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
…chenkov

Add `Drop::pin_drop` for pinned drops





This PR is part of the `pin_ergonomics` experiment (the tracking issue is rust-lang#130494). It allows implementing `Drop` with a pinned `self` receiver, which is required for safe pin-projection.

Implementations:
- [x] At least and at most one of `drop` and `pin_drop` should be implemented.
- [x] No direct call of `drop` or `pin_drop`. They should only be called by the drop glue.
- [x] `pin_drop` must and must only be used with types that support pin-projection (i.e. types with `#[pin_v2]`).
- [ ] Allows writing `fn drop(&pin mut self)` and desugars to `fn pin_drop(&pin mut self)`. (Will be in the next PRs)
…-Simulacrum

Implement `core::arch::return_address` and tests

Tracking issue: rust-lang#154966

Implements libs-team#768
std fs tests: avoid matching on OS-provided error string

These tests are [ancient](rust-lang@6bfbad9). No idea why there written in this style back then, but today we'd clearly check the `ErrorKind`, not the string.

r? @ChrisDenton
…ark-Simulacrum

core: Replace `ptr::slice_from_raw_parts` with `slice::from_raw_parts`
…r=nia-e

stream_send_recv_stress tests: wait for threads to finish

These tests currently fail in Miri (when run with nextest) because all they do is spawn a lot of threads that will do stuff, but they don't wait for the threads to actually finish. Miri by default errors when there are background threads lingering when `main` is done (since that can indicate a leak, and since it makes it impossible to check for memory leaks). Miri gives background threads a bit of time to finish when `main` is done, but for these tests that's nowhere near enough since basically the entire test runs after `main` is done.

Outside Miri, this could also still mean that the test doesn't actually run to completion, it might get abort when `main` finishes.

So let's use `thread::scope` to ensure all threads are done before the test is considered done.
…nathanBrouwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang#156394 (miri subtree update)
 - rust-lang#154972 (Implement `core::arch::return_address` and tests)
 - rust-lang#155679 (rustdoc: Reify emission types)
 - rust-lang#155982 (Fix closure HIR span context mismatch)
 - rust-lang#156323 (Handle --print=backend-has-mnemonic in cg_clif)
 - rust-lang#156387 (std fs tests: avoid matching on OS-provided error string)
 - rust-lang#156129 (compiletest: Migrate from `PassMode`/`FailMode` to `PassFailMode`)
 - rust-lang#156192 (core: Replace `ptr::slice_from_raw_parts` with `slice::from_raw_parts`)
 - rust-lang#156365 (stream_send_recv_stress tests: wait for threads to finish)
 - rust-lang#156368 (Fix invalid unreachable in is_known_valid_scrutinee for Reborrow)
remove forever-deprecated and hidden `f64` methods



The methods `f64::is_positive` and `f64::is_negative` were deprecated since 1.0 and marked as `#[doc(hidden)]` in favor of `f64::is_sign_positive` and `f64::is_sign_negative`. They also only exist on `f64`, not on `f32`. But for some unknown reason, they have been marked as stable.

This PR proposes to remove both methods as they were never a part of the documented API, assuming that a crater run finds no significant breakage.
Use LLVM intrinsics for `f16` to `{i,u}16` intrinsics
tests: ip*_properties: avoid parsing the IP over and over again

This test somehow takes 12s to execute in Miri (on CI, i.e. on a slow machine), despite not having any loop. I suspect it's caused by us for some reason re-parsing the same string again and again. Let's just not do that.
prepare fs tests for miri

- reduce iteration counts to get rid of timeouts
- disable one test that relies on spawning processes
…reads, r=Mark-Simulacrum

kernel_copy tests: properly join background threads

This helps Miri because when there are threads just hanging in the background, we cannot check for memory leaks.

I think even without Miri this currently leads to 100% CPU load on one core for each of these threads: once the test function returns and `sink` gets dropped, the `read` in the thread will always immediately return `0`, and then we just loop with that forever until the process exits.
…mulacrum

Improve doc comments for f32::ceil() and f32::floor()

Previously ::floor() included an example showing behaviour for negative values, but ::ceil() did not. Ensure both have examples of the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
…egers, r=Urgau

Fix unwanted "Available on XX-bit only" in libcore integers

Fixes rust-lang#149786.

The problem came from:

<img width="754" height="734" alt="image" src="https://github.com/user-attachments/assets/c251326f-8640-420d-bc4c-a3246390ea67" />

The `doc_cfg` feature picks the `cfg` as it should. If we don't want it, we simply need to disable the feature on it. With this fix, no more `cfg` annotations:

<img width="860" height="590" alt="image" src="https://github.com/user-attachments/assets/da793590-bf43-4874-94e1-a56809938420" />

r? @Urgau
It was previously not visible (unless compiling docs for amdgpu, which
I guess nobody does).
Follow other specific intrinsics and always include them in docs.
JonathanBrouwer and others added 27 commits May 29, 2026 09:06
…, r=JohnTitor

[AIX] Sync compiler and std with libc changes

This patch updates the compiler and std code to match recent libc updates affecting AIX targets. In particular:

- Fix `libc::loadquery` to use `*mut c_void` instead of `*mut u8`, which is aligned with the expected FFI signature.
- Replace `st_*time` stat fields with the newer `st_atim`, `st_mtim`, `st_ctim` fields across AIX-specific filesystem code.
…ubilee

android: implement file locking by calling flock

Fixes rust-lang#148325
- Unsafe core must be documented.
- Types from dependencies must be inlined.
- These types are only used within `core` so `pub` must be replaced with `pub(crate)`.
Wire up runtime detection for the `clflushopt` feature: add it to the
`is_x86_feature_detected!` feature list (gated on `clflushopt_target_feature`),
enable it from CPUID leaf 7 EBX bit 23, and add it to the std_detect
x86-specific dump test.
…trochenkov

Various proc-macro related code cleanups

Some are just misc cleanups. Others are to make the proc-macro ABI and RPC interface a bit less target dependent. I've got some local changes that change the ABI to what is effectively a single `&[extern "C" fn(BridgeConfig<'_>) -> Buffer]` export.
std::offload sharedmem

@Sa4dUs @kevinsala This simply allows requesting shared-memory for gpu kernels at launch time via std::offload. The actual work to access the shared memory inside the kernel has already landed independent of the offload work in rustc, so we're building on that.

cc @Flakebi (thanks for your work!)
…r=folkertdev

Add the `clflushopt` x86 target feature

Adds the unstable `clflushopt` x86 target feature, gated behind
`#![feature(clflushopt_target_feature)]`.

`CLFLUSHOPT` is a standalone x86 CPUID feature (Intel Skylake+ / AMD
Excavator+, ~2015) that is not part of any psABI microarchitecture level, so it
needs its own feature flag.

**This is the compiler half of a two-PR feature and is a hard dependency for the
stdarch side.** The `_mm_clflushopt` intrinsic (rust-lang/stdarch#1456) cannot
compile until this target feature exists, so the stdarch PR is blocked on this
one merging and syncing into stdarch's pinned toolchain.

- Tracking issue: rust-lang#157096
- Unblocks intrinsic: rust-lang/stdarch#1456

This mirrors the existing unstable x86 target features (e.g. `movrs`, `apxf`).
`clflushopt` is a standard LLVM x86 feature name, so it maps 1:1 through
`to_llvm_features` with no remap entry needed.

r? compiler
Move `IoSlice` and `IoSliceMut` to `core::io`





ACP: rust-lang/libs-team#755
Tracking issue: rust-lang#154046
Related: rust-lang#152918
Related: rust-lang#155625

## Description

Moves `std::io::IoSlice` and `std::io::IoSliceMut` into `core::io`. This is required for the `Read` and `Write` traits to be moved into `alloc` and/or `core`, as they contain stable methods which work with IO slices. Similar to rust-lang#155574, this PR inlines the `std::sys` types required to create an ABI compatible type for the platforms where such compatibility is guaranteed.

Additionally, I've moved the relevant tests out of `std::io::tests` into `coretests::io::io_slice`.

---

## Notes

* This PR overlaps with rust-lang#152918, but goes further than moving the IO slice types to `alloc` and instead moves them straight to `core`. Since these types have no interaction with allocation, and doing so will allow `Write` to move to `core::io`, I consider this a better home for these types.
* Some discussion around the decision to not use a `core::sys` module can be found [here](rust-lang#155574 (comment)).
* I've renamed `unsupported` to `generic` to better reflect that `IoSlice(Mut)` _is_ supported by all platforms, it just doesn't have a special ABI-compatible type. I don't want to imply that parts of `core` "don't work" depending on the target; `IoSlice(Mut)` works exactly as expected on all targets.
* I've made `pub` items within each platform-specific representation `pub(super)` to highlight that everything within `core::io::io_slice` is an internal implementation detail not meant for any other part of the crate to be aware of.
* No AI tooling of any kind was used during the creation of this PR.
Make hint::cold_path #[cold] so that it works even if the MIR inliner can't inline it

This fixes rust-lang#156859 because the branch weight metadata is actually keyed off seeing a `#[cold]` function call in an arm. We don't need the intrinsic, any `#[cold]` function will do. So if the hint wrapper itself is made `#[cold]`, we will still get the desired effect, and LLVM will clean up the call to an empty function when optimizations are enabled.
…nathanBrouwer

Rollup of 8 pull requests

Successful merges:

 - rust-lang#156863 (Make hint::cold_path #[cold] so that it works even if the MIR inliner can't inline it)
 - rust-lang#156875 (Correct and document semantics of `yield` terminator)
 - rust-lang#157115 ([rustdoc] Fix foreign items macro expansion)
 - rust-lang#157150 (Revert "drop derive helpers during ast lowering" )
 - rust-lang#156887 (Rename `-Zdebuginfo-for-profiling` switch)
 - rust-lang#157039 (rustdoc: correctly propagate cfgs for glob reexports)
 - rust-lang#157125 (Rewrite the `#[repr]` attribute parser)
 - rust-lang#157154 (Revert workaround used to select the gcc codegen in the coretests CI)
net tests: let the OS pick the port numbers

This finishes what I started in rust-lang#156385.
Fixes rust-lang#156377.
std::process: uefi: avoid panicking in Stdio From impls.

map io::Stdout/Stderr to Stdio::Inherit and File to a new InheritFile variant returning io::Error from output() instead of aborting.
…nts, r=jhpratt

Migrate libraries from ptr::slice_from_raw_parts to .cast_slice

Tracking issue for `#![feature(ptr_cast_slice)]`: rust-lang#149103
This commit updates most callsites of ptr::slice_from_raw_parts within ./library to the more concise but unstable postfix `.cast_slice()` method on raw pointers, using the `ptr_cast_slice` feature. Some tests in alloctests have also been updated.

No functional change, debatably improved readability.
Instead of saying that `zip()` zips (which is nearly useless because
either people already understood the function name and don’t need the
introduction, or they didn’t and reiterating it doesn’t help), we can
explain what it does more explicitly, in only a few more words.

This brings the first paragraphs closer in meaning to the second
paragraphs, but they are still distinct: the first paragraph explains
the overall goal without individual cases, and the second paragraph
explains the full behavior case-by-case.
Clarify documentation of `Option::{zip, zip_with}()`.

Instead of saying that `zip()` zips (which is nearly useless because either people already understood the function name and don’t need the introduction, or they didn’t and reiterating it doesn’t help), we can explain what it does more explicitly, in only a few more words.

This brings the first paragraphs closer in meaning to the second paragraphs, but they are still distinct: the first paragraph explains the overall goal without individual cases, and the second paragraph explains the full behavior case-by-case.

@rustbot label +A-docs
directory handles: add Dir::metadata

Adds a `metadata` method to the `fs::Dir` type so that one can fetch the metadata of a directory directly from a handle. This is very similar to `File::metadata`. In fact we reuse the existing implementation, which reduces code duplication but also is a bit hacky.

r? @the8472
Tracking issue: rust-lang#120426
Rollup of 4 pull requests

Successful merges:

 - rust-lang#157192 (directory handles: add Dir::metadata)
 - rust-lang#157171 ( rustdoc: Separate the caches for synthetic auto trait & blanket impls)
 - rust-lang#157185 (Don't lower `inner_span` multiple times)
 - rust-lang#157211 (use custom `Exhaustive` enum instead of `bool`)
@feliperodri feliperodri added the Maintenance Maintenance related issues for the challange label Aug 27, 2026
@feliperodri feliperodri self-assigned this Aug 27, 2026
BorrowedBuf {
// SAFETY: initialized data never becoming uninitialized is an invariant of BorrowedBuf
buf: unsafe { (slice as *mut [u8]).as_uninit_slice_mut().unwrap() },
buf: unsafe { &mut *(slice as *mut [u8] as *mut [MaybeUninit<u8>]) },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance Maintenance related issues for the challange

Projects

None yet

Development

Successfully merging this pull request may close these issues.