Skip to content

Merge subtree update for toolchain nightly-2025-07-02 #407

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

Open
wants to merge 10,000 commits into
base: main
Choose a base branch
from

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Jul 4, 2025

This is an automated PR to merge library subtree updates from 2025-06-17 (rust-lang/rust@45acf54) to 2025-07-02 (rust-lang/rust@71e4c00) (inclusive) into main. git merge resulted in conflicts, which require manual resolution. Files were commited with merge conflict markers. Do not remove or edit the following annotations:
git-subtree-dir: library
git-subtree-split: 46c01c8

tgross35 and others added 30 commits June 10, 2025 07:02
Specify the behavior of `file!`

This takes the current behavior of `file!` and documents it so it is safe to make assumptions about.
For example, Cargo could provide a `CARGO_RUSTC_CURRENT_DIR` as a base path for `file!`.

Example use cases
- Being able to look up test assets relative to the current file ([example](https://github.com/rust-lang/cargo/blob/b9026bf654d7fac283465e58b8b76742244ef07d/tests/testsuite/cargo_add/add_basic/mod.rs#L34))
- Inline snapshotting libraries being able to update Rust source code ([example](https://github.com/rust-lang/cargo/blob/b9026bf654d7fac283465e58b8b76742244ef07d/tests/testsuite/alt_registry.rs#L36-L45))

See rust-lang/cargo#3946 for more context.

T-libs-api discussed two solutions in rust-lang/libs-team#478
- `file_absolute!`:
  - Has less meaning in other build tools like buck2
  - Bakes in the assumption that a full path is available (e.g. with trim-paths)
- Specifying `file!`s behavior (this PR):
  - Leaves it to the user to deal with trim-paths
  - Even though `file!` is currently unspecified, changing it would likely have too large of an impact on the ecosystem at this time.

A future possibility is that rustc could have a flag that controls modifies the base path used for `file!`.
That seems purely additive with specifying the behavior and we do not want to block on it.
It would also likely be too disruptive for Cargo users (as mentioned). However, we tried to keep this in mind when specifying the behavior.
…viscross,tgross35

Stabilize keylocker

This PR stabilizes the feature flag `keylocker_x86` (tracking issue rust-lang#134813).

# Public API
The 2 `x86` target features `kl` and `widekl`, and the associated intrinsics in stdarch.

These target features are very specialized, and are only used to signal the presence of the corresponding CPU instruction. They don't have any nontrivial interaction with the ABI (contrary to something like AVX), and serve the only purpose of enabling 11 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update.

Also, these were added way back in LLVM12, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too!

# Associated PRs
 - rust-lang#134814
 - rust-lang/stdarch#1706
 - rust-lang#136831 (stdarch submodule update)
 - rust-lang/stdarch#1795 (stabilizing the runtime detection and intrinsics)
 - rust-lang#141964 (stdarch submodule update for the stabilization of the runtime detection and intrinsics)

As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now.

cc ````@rust-lang/lang````
cc ````@rust-lang/libs-api```` for the intrinsics and runtime detection

I don't think anyone else worked on this feature, so no one else to ping, maybe cc ````@Amanieu.```` I will send the reference pr soon.
…on, r=tgross35

use `#[naked]` for `__rust_probestack`

Let's see if this works now.

Previously this change was in rust-lang/compiler-builtins#897, but we decided to wait until `compiler-builtins` was a subtree (and also `cfg(bootstrap)` is gone now).

r? ``@tgross35``  cc ``@bjorn3``

try-job: `dist-various*`
try-job: `test-various*`
…39190-pt2, r=workingjubilee

core::ptr: deduplicate more method docs

used `rg -Fxf library/core/src/ptr/{const,mut}_ptr.rs` to find duplicated doc comments, and `diff -u` after copying them to files to ensure they are actually identical.

`sed 's| */// *||'` was then used to translate the doc comments to plain markdown.

part of rust-lang#139190
…ing_docs, r=tgross35

docs: Small clarification on the usage of read_to_string and read_to_end trait methods

Small clarification on the usage of read_to_string and read_to_end trait methods. The goal is to make it clear that these trait methods will become locked up if attempting to read to the end of stdin (which is a bit non-sensical unless the other end closes the pipe).

Fixes: rust-lang#141714
Mark `core::slice::memchr` as `#[doc(hidden)]`

It's purely internal, and not intended to be a public API, even on nightly. This stops it showing up and being misleading in rustdoc search.

It also mirrors the (also internal) `core::slice::sort` module.
- Rewords existing Considerations section on `fetch_update` and friends
to make clear that the limitations are inherent to an implementation based on any
CAS operation, rather than the weak version of `compare_exchange` in particular
- Add Considerations to `compare_exchange` and `compare_exchange_weak`
which details similar considerations and when they may be relevant.
allows to have a tigher control over the binding exclusivness of the
socket.
Implements `trim_prefix` and `trim_suffix` methods for both `slice` and
`str` types which remove at most one occurrence of a prefix/suffix while
always returning a string/slice (rather than Option), enabling easy
method chaining.
This removes the `compiler_builtins` dependency from a handful of
library dependencies, which is progress toward [1].

[1]: rust-lang#142265
0.37.0 is a semver-breaking release but the only breakage is in
`elf::R_RISCV_GNU_*` and `pe::IMAGE_WEAK_EXTERN_*` constants, as well as
Mach-O dyld. This API is not used by `std`, so we should be fine to
upgrade.

This new version also includes functionality for parsing Wasm object
files that we may eventually like to make use of.

Also includes the minor bump from 0.37.0 to 0.37.1 to help [1].

Changelog: https://github.com/gimli-rs/object/blob/master/CHANGELOG.md#0370

[1]: rust-lang#142265
0.25.0 is a breaking change only because it upgrades the `gimli`
version. It also includes a change to the `compiler-builtins` dependency
that helps with [1].

Changelog: https://github.com/gimli-rs/addr2line/blob/master/CHANGELOG.md#0250-20250611

[1]: rust-lang#142265
This comes with a `gimli` upgrade, so we no longer have two different
versions.
Faster fmt::Display of 128-bit integers, without unsafe pointer

In followup of rust-lang#135265, hereby the 128-bit part.

* Batches per 16 instead of 19 digits
* Buffer access as array insteaf of unsafe pointer
* Added test coverage for i128 and u128

r? tgross35 ChrisDenton
compiler & tools dependencies:
     Locking 57 packages to latest compatible versions
    Updating anstream v0.6.18 -> v0.6.19
    Updating anstyle v1.0.10 -> v1.0.11
    Updating anstyle-lossy v1.1.3 -> v1.1.4
    Updating anstyle-parse v0.2.6 -> v0.2.7
    Updating anstyle-query v1.1.2 -> v1.1.3
    Updating anstyle-svg v0.1.7 -> v0.1.8
    Updating anstyle-wincon v3.0.7 -> v3.0.9
    Updating bitflags v2.9.0 -> v2.9.1
    Updating bumpalo v3.17.0 -> v3.18.1
    Updating bytecount v0.6.8 -> v0.6.9
    Updating camino v1.1.9 -> v1.1.10
    Updating clap v4.5.38 -> v4.5.39
    Updating clap_builder v4.5.38 -> v4.5.39
    Updating color-eyre v0.6.4 -> v0.6.5
    Updating color-spantrace v0.2.2 -> v0.3.0
    Updating colorchoice v1.0.3 -> v1.0.4
    Updating curl v0.4.47 -> v0.4.48
    Updating curl-sys v0.4.80+curl-8.12.1 -> v0.4.82+curl-8.14.1
    Updating errno v0.3.11 -> v0.3.12
    Updating flate2 v1.1.1 -> v1.1.2
    Updating hashbrown v0.15.3 -> v0.15.4
    Updating hermit-abi v0.3.9 -> v0.5.1
    Updating icu_properties v2.0.0 -> v2.0.1
    Updating icu_properties_data v2.0.0 -> v2.0.1
    Updating jiff v0.2.13 -> v0.2.14
    Updating jiff-static v0.2.13 -> v0.2.14
    Updating jsonpath-rust v1.0.1 -> v1.0.2
    Updating libloading v0.8.7 -> v0.8.8
    Updating lock_api v0.4.12 -> v0.4.13
    Updating num_cpus v1.16.0 -> v1.17.0
      Adding once_cell_polyfill v1.70.1
    Updating openssl-sys v0.9.108 -> v0.9.109
    Updating owo-colors v4.2.0 -> v4.2.1
    Updating parking_lot v0.12.3 -> v0.12.4
    Updating parking_lot_core v0.9.10 -> v0.9.11
    Updating portable-atomic v1.11.0 -> v1.11.1
    Updating rustc-build-sysroot v0.5.7 -> v0.5.8
    Updating rustversion v1.0.20 -> v1.0.21
    Updating serde_spanned v0.6.8 -> v0.6.9
    Updating smallvec v1.15.0 -> v1.15.1
    Updating socket2 v0.5.9 -> v0.5.10
    Updating sysinfo v0.35.0 -> v0.35.2
    Updating tokio v1.45.0 -> v1.45.1
    Updating toml_datetime v0.6.9 -> v0.6.11
    Updating tracing-attributes v0.1.28 -> v0.1.29
    Updating type-map v0.5.0 -> v0.5.1
    Updating uuid v1.16.0 -> v1.17.0
    Updating wasm-encoder v0.230.0 -> v0.233.0
    Updating wasmparser v0.230.0 -> v0.233.0
    Updating wast v230.0.0 -> v233.0.0
    Updating wat v1.230.0 -> v1.233.0
    Updating windows-bindgen v0.61.0 -> v0.61.1
    Updating windows-core v0.61.0 -> v0.61.2
    Updating windows-future v0.2.0 -> v0.2.1
    Updating windows-result v0.3.2 -> v0.3.4
    Updating windows-strings v0.4.0 -> v0.4.2
      Adding windows-threading v0.1.0
note: pass `--verbose` to see 38 unchanged dependencies behind latest

library dependencies:
     Locking 1 package to latest compatible version
    Updating hashbrown v0.15.3 -> v0.15.4
note: pass `--verbose` to see 5 unchanged dependencies behind latest

rustbook dependencies:
     Locking 39 packages to latest compatible versions
    Updating anstream v0.6.18 -> v0.6.19
    Updating anstyle v1.0.10 -> v1.0.11
    Updating anstyle-parse v0.2.6 -> v0.2.7
    Updating anstyle-query v1.1.2 -> v1.1.3
    Updating anstyle-wincon v3.0.7 -> v3.0.9
    Updating bitflags v2.9.0 -> v2.9.1
    Updating bumpalo v3.17.0 -> v3.18.1
    Updating cc v1.2.22 -> v1.2.26
    Updating clap v4.5.38 -> v4.5.39
    Updating clap_builder v4.5.38 -> v4.5.39
    Updating clap_complete v4.5.50 -> v4.5.52
    Updating colorchoice v1.0.3 -> v1.0.4
    Updating errno v0.3.11 -> v0.3.12
    Updating flate2 v1.1.1 -> v1.1.2
    Updating hashbrown v0.15.3 -> v0.15.4
    Updating icu_properties v2.0.0 -> v2.0.1
    Updating icu_properties_data v2.0.0 -> v2.0.1
    Updating jiff v0.2.13 -> v0.2.14
    Updating jiff-static v0.2.13 -> v0.2.14
    Updating lock_api v0.4.12 -> v0.4.13
      Adding once_cell_polyfill v1.70.1
    Updating opener v0.8.1 -> v0.8.2
    Updating parking_lot v0.12.3 -> v0.12.4
    Updating parking_lot_core v0.9.10 -> v0.9.11
    Updating portable-atomic v1.11.0 -> v1.11.1
    Updating railroad v0.3.2 -> v0.3.3
    Updating rustversion v1.0.20 -> v1.0.21
    Updating serde_spanned v0.6.8 -> v0.6.9
    Updating smallvec v1.15.0 -> v1.15.1
    Updating tempfile v3.19.1 -> v3.20.0
    Updating toml v0.8.22 -> v0.8.23
    Updating toml_datetime v0.6.9 -> v0.6.11
    Updating toml_edit v0.22.26 -> v0.22.27
    Updating toml_write v0.1.1 -> v0.1.2
      Adding unicode-width v0.2.0
    Updating web_atoms v0.1.2 -> v0.1.3
    Updating windows-core v0.61.0 -> v0.61.2
    Updating windows-result v0.3.2 -> v0.3.4
    Updating windows-strings v0.4.0 -> v0.4.2
matthiaskrgr and others added 21 commits June 28, 2025 22:05
… r=Mark-Simulacrum

std::net: adding `unix_socket_exclbind` feature for solaris/illumos.

allows to have a tigher control over the binding exclusivness of the socket.

ACP: rust-lang/libs-team#366
… r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.
…t, r=Mark-Simulacrum

update internal `send_signal` comment

the vxwork did not have the old comment updated in rust-lang#141990 so update here;

signaling -> sending signals to because the latter reads better to me.
…k-Simulacrum

BTreeSet: remove duplicated code by reusing `from_sorted_iter`

The method `BTreeSet::from_sorted_iter` was introduced in 49ccb75, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.
…acrum

Clarify doc comment on unix OpenOptions
- Update ui.md
- Update type-alias-impl-trait.md
- Update README.md
…jubilee

Add SIMD funnel shift and round-to-even intrinsics

This PR adds 3 new SIMD intrinsics

 - `simd_funnel_shl` - funnel shift left
 - `simd_funnel_shr` - funnel shift right
 - `simd_round_ties_even` (vector version of `round_ties_even_fN`)

TODO (future PR): implement `simd_fsh{l,r}` in miri, cg_gcc and cg_clif (it is surprisingly hard to implement without branches, the common tricks that rotate uses doesn't work because we have 2 elements now. e.g, the `-n&31` trick used by cg_gcc to implement rotate doesn't work with this because then `fshl(a, b, 0)` will be `a | b`)

[#t-compiler > More SIMD intrinsics](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/More.20SIMD.20intrinsics/with/522130286)

`@rustbot` label T-compiler T-libs A-intrinsics F-core_intrinsics
r? `@workingjubilee`
Add an empty `impl ! {}` so `rustdoc` generates auto trait impls and blanket impls on `!`'s documentation page.
Workaround for memory unsafety in third party DLLs

Resolves rust-lang#143078

Note that we can't make any guarantees if third parties intercept OS functions and don't implement them according to the documentation. However, I think it's practical to attempt mitigations when issues are encountered in the wild and the mitigation itself isn't too invasive.
fix typos and improve clarity in documentation

```
Description:

This pull request corrects minor typos and improves wording for clarity across several documentation files, including:

- Correcting instrinsics → intrinsics
- Correcting preferrably → preferably
- Correcting Orginally → Originally
-  Correcting resiliant → resilient

```
Rollup of 14 pull requests

Successful merges:

 - rust-lang#142429 (`tests/ui`: A New Order [13/N])
 - rust-lang#142514 (Miri: handling of SNaN inputs in `f*::pow` operations)
 - rust-lang#143066 (Use let chains in the new solver)
 - rust-lang#143090 (Workaround for memory unsafety in third party DLLs)
 - rust-lang#143118 (`tests/ui`: A New Order [15/N])
 - rust-lang#143159 (Do not freshen `ReError`)
 - rust-lang#143168 (`tests/ui`: A New Order [16/N])
 - rust-lang#143176 (fix typos and improve clarity in documentation)
 - rust-lang#143187 (Add my work email to mailmap)
 - rust-lang#143190 (Use the `new` method for `BasicBlockData` and `Statement`)
 - rust-lang#143195 (`tests/ui`: A New Order [17/N])
 - rust-lang#143196 (Port #[link_section] to the new attribute parsing infrastructure)
 - rust-lang#143199 (Re-disable `tests/run-make/short-ice` on Windows MSVC again)
 - rust-lang#143219 (Show auto trait and blanket impls for `!`)

r? `@ghost`
`@rustbot` modify labels: rollup
…r=joshtriplett

Implement `Random` for tuple

Implement `Random` for tuples of arity 12 or less. Each element is expected to implement `Random`.

I think it's OK to implement this trait for the following types:

- Primitive integer types and `bool`
- Arrays and tuples of the above values
- ~~`NonZero<T>`~~, `Saturating<T>` and `Wrapping<T>`

The necessity of this trait is debated (<rust-lang#130703 (comment)>), but if we decide to keep it in the future when the `random` module is stabilized, I think it would be useful to have this trait implemented for tuples.

Tracking issue: rust-lang#130703

r? `@joboet`
…tgross35

Describe Future invariants more precisely
docs(fs): Touch up grammar on lock api
@github-actions github-actions bot requested a review from a team as a code owner July 4, 2025 07:43
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.