Skip to content

Merge subtree update for toolchain nightly-2025-06-03 #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10,000 commits into from
Jun 17, 2025
Merged

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Jun 5, 2025

This is an automated PR to merge library subtree updates from 2025-06-02 (rust-lang/rust@99e7c15) to 2025-06-03 (rust-lang/rust@5d707b0), inclusive. This is a clean merge, no conflicts were detected. Do not remove or edit the following annotations:
git-subtree-dir: library
git-subtree-split: 018adbd

matthiaskrgr and others added 30 commits May 10, 2025 16:26
… r=Amanieu

Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`

`DerefMut` is instantly stable, as a trait impl. That means this needs an FCP.

``@rustbot`` label +needs-fcp

rust-lang/libs-team#429
…ntrinsic, r=Mark-Simulacrum

remove intrinsics::drop_in_place

This was only ever accidentally stable, and has been marked as deprecated since Rust 1.52, released almost 4 years ago. We've removed the old serialization `derive`s, maybe we can remove this one as well?

As suggested by ``@jhpratt,`` let's see what crater says for this one.
remove 'unordered' atomic intrinsics

As their doc comment already indicates, these operations do not currently have a place in our memory model. The intrinsics were introduced to support a hack in compiler-builtins, but that hack recently got removed (see rust-lang/compiler-builtins#788).
Update documentation of OnceLock::get_or_init.

Explicitly point out that if the function panics the init function might be called multiple times.
…-Simulacrum

Update hermit-abi to 0.5.1

This updates hermit-abi to version 0.5.1, bringing the [recent `AF_*`](rust-lang/libc#4344) changes to std.
…r=scottmcm,traviscross,tgross35

Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations

This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations.

This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them.

Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`.

r? `@tgross35`

try-job: aarch64-gnu
try-job: dist-various-1
try-job: dist-various-2

[^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
…_lite, r=BurntSushi

Split duration_constructors to get non-controversial constructors out

This implements rust-lang#140881
The output of Array::map is intended to be an array of the same size, and does not modify the
original in place nor is it intended for side-effects. Thus, under normal circumstances it should be consumed.

See [discussion](https://internals.rust-lang.org/t/array-map-annotate-with-must-use/22813/26).

Attaching to tracking issue rust-lang#75243
Since [1], `compiler-builtins` makes a certain set of math symbols
weakly available on all platforms. This means we can begin exposing some
of the related functions in `core`, so begin this process here.

It is not possible to provide inherent methods in both `core` and `std`
while giving them different stability gates, so standalone functions are
added instead. This provides a way to experiment with the functionality
while unstable; once it is time to stabilize, they can be converted to
inherent.

For `f16` and `f128`, everything is unstable so we can move the inherent
methods.

The following are included to start:

* floor
* ceil
* round
* round_ties_even
* trunc
* fract
* mul_add
* div_euclid
* rem_euclid
* powi
* sqrt
* abs_sub
* cbrt

These mirror the set of functions that we have in `compiler-builtins`
since [1].

Tracking issue: rust-lang#137578

[1]: rust-lang/compiler-builtins#763
Many float-related tests in `std` only depend on `core`, so move the
tests there. This also allows us to verify functions from
`core_float_math`.

Since the majority of test files need to be moved to `coretests`, move
the files here without any cleanup; this is done in a followup commit.
This makes git history slightly cleaner, but coretests will not build
immediately after this commit.
They will be used in Clippy to detect runtime parsing of known-valid
IP addresses.
The previous commit moved all test files from `std` to `core` so git
understands the move. Not all functionality is actually testable in
`core`, however, so perform move the relevant portions back. Changes
from inherent to module methods is also done since this is the form of
math operations available in `core` (as `core_float_math`).
Per [1], MinGW has an incorrect fma implementation. This showed up in
tests run with cranelift after adding float math operations to `core`.
Presumably we hadn't noticed this when running tests with LLVM because
LLVM was constant folding the result away.

Rust issue: rust-lang#140515

[1]: https://sourceforge.net/p/mingw-w64/bugs/848/
…, r=tgross35

MaybeUninit::write: fix doc

# Fix doc for `MaybeUninit::write`

The documentation refers to the way `MaybeUninit` stores data internally. The property of not dropping content on context exit is the responsibility of `ManuallyDrop`.
This updates some doctests that fail to run on android. We will soon be
supporting cross-compiled doctests, and the `arm-android` job fails to
run these tests.

In summary:
- Android re-exports some traits from linux under a different path.
- Android doesn't seem to have common unix utilities like `true`,
  `false`, or `whoami`, so these are disabled.
Currently, the code for process aborts is duplicated across `panic_abort` and `std`. This PR uses `#[rustc_std_internal_symbol]` to make the `std` implementation available to `panic_abort` via the linker, thereby deduplicating the code.
@github-actions github-actions bot requested a review from a team as a code owner June 5, 2025 14:08
@carolynzech carolynzech closed this Jun 5, 2025
@carolynzech carolynzech reopened this Jun 5, 2025
@tautschnig
Copy link
Member

Requires #386 to be merged first.

@carolynzech carolynzech closed this Jun 9, 2025
@carolynzech carolynzech reopened this Jun 9, 2025
@carolynzech
Copy link

The check_is_ascii harness is failing:

2025-06-10T00:29:47.6611531Z  ** 2 of 97 failed (95 undetermined)
2025-06-10T00:29:47.6612227Z Failed Checks: unwinding assertion loop 0
2025-06-10T00:29:47.6613063Z  File: "/home/runner/work/verify-rust-std/verify-rust-std/head/library/core/src/slice/ascii.rs", line 489, in slice::ascii::is_ascii
2025-06-10T00:29:47.6613834Z Failed Checks: unwinding assertion loop 2
2025-06-10T00:29:47.6614572Z  File: "/home/runner/work/verify-rust-std/verify-rust-std/head/library/core/src/slice/ascii.rs", line 502, in slice::ascii::is_ascii
2025-06-10T00:29:47.6615208Z 
2025-06-10T00:29:47.6615310Z VERIFICATION:- FAILED
2025-06-10T00:29:47.6615691Z [Kani] info: Verification output shows one or more unwinding failures.
2025-06-10T00:29:47.6616315Z [Kani] tip: Consider increasing the unwinding value or disabling `--unwinding-assertions`.
2025-06-10T00:29:47.6616842Z Verification Time: 3.6555307s
2025-06-10T00:29:47.6620172Z 

I suspect because the newest Kani version enables the sse2 target feature for x86 architectures, which means that we look at this version of is_ascii:

#[cfg(all(target_arch = "x86_64", target_feature = "sse2"))]
#[inline]
const fn is_ascii(bytes: &[u8]) -> bool {

instead of this one, where the loop invariant is:

#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
#[inline]
#[rustc_allow_const_fn_unstable(const_eval_select)] // fallback impl has same behavior
const fn is_ascii(s: &[u8]) -> bool {

@thanhnguyen-aws can you add a loop invariant to the other function so that the proof passes again?

@carolynzech
Copy link

Re: disabling ./x test. We were getting a duplicate lang item error. I suspect that it's caused by rust-lang#119899, which implements a stage 0 bootstrap redesign.

The blog post describing this change suggests:

The minimum stage to check, build and test the standard library is now stage 1. ./x {check,build,test} library --stage=0 are now no-ops; switch to --stage 1 instead.

I did that, but that produces this new error:

error[E0514]: found crate `safety` compiled by an incompatible version of rustc
    --> library/core/src/ptr/mod.rs:2090:3
     |
2090 | #[safety::requires(ub_checks::can_dereference(src))]
     |   ^^^^^^
     |
     = note: the following crate versions were found:
             crate `safety` compiled by rustc 1.88.0-beta.4 (95597e848 2025-05-25): /private/var/folders/2r/g_zkltvs27d511hds3r2_rsw0000gq/T/check_rustc_XXXXXX.7FYUACIWO7/build/aarch64-apple-darwin/stage1-std/release/deps/libsafety-59a79aebc2fdb0fb.dylib
     = help: please recompile that crate using this compiler (rustc 1.89.0-nightly (5d707b07e 2025-06-02)) (consider running `cargo clean` first)

For more information about this error, try `rustc --explain E0514`.
error: could not compile `core` (lib) due to 45 previous errors

(The cargo clean suggestion doesn't work, I tried).

This error doesn't make sense to me--if I'm understanding the change correctly, the bootstrap sequence should only build the standard library with the stage1 nightly compiler, so I don't understand how a version of this crate compiled with the stage0 beta compiler would be hanging around. I think there's two possibilities here:

  1. There's a bug in the new bootstrap sequence where it can't handle the case where the local standard library adds a new crate, or
  2. I'm misunderstanding something here and we just need to change something on our end to fix it

For the sake of unblocking this upgrade sooner rather than later, I'm inclined to just turn ./x test off for now. It seems like they're still doing quite a bit of work upstream on this feature (e.g. rust-lang#141914), so if the issue is on their end, I wouldn't be surprised if it gets fixed without us doing anything. I can keep retrying it periodically to see if it gets fixed, and if it doesn't, I can go on Zulip and ask for some help.

@tautschnig
Copy link
Member

Looks like the loop invariant still needs work for we appear to require a modifies clause:

Failed Checks: Check assigns clause inclusion for loop slice::ascii::is_ascii.0

@carolynzech carolynzech enabled auto-merge June 17, 2025 15:11
@carolynzech carolynzech added this pull request to the merge queue Jun 17, 2025
Merged via the queue into main with commit 9949c4a Jun 17, 2025
46 of 48 checks passed
@carolynzech carolynzech deleted the sync-2025-06-03 branch June 17, 2025 17:22
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.