Skip to content

Merge subtree update for toolchain nightly-2026-08-21 - #687

Open
github-actions[bot] wants to merge 10000 commits into
mainfrom
sync-2026-08-21
Open

github-actions[bot] wants to merge 10000 commits into
mainfrom
sync-2026-08-21

Conversation

@github-actions

Copy link
Copy Markdown

This is an automated PR to merge library subtree updates from 2026-02-05 (rust-lang/rust@db3e99b) to 2026-08-21 (rust-lang/rust@8925ea3) (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: 767896b

GuillaumeGomez and others added 30 commits August 5, 2026 17:07
LLVM 21 preserves the bounds assumption but does not eliminate the aggregate phi that LLVM 22 removes. Check each version's supported optimization and restore the shared postcondition so direct callers can eliminate bounds checks.
…est, r=Urgau

[rustdoc] Do not take `doc(cfg())` into account when filtering doctests

Part of rust-lang#147033.

Because it was using the `extract_cfg_from_attrs` common function, it was taking into account the `doc(cfg())` attributes the same as if they were a `cfg`.

I didn't mark this PR as "fix" because I didn't handle the case of the doctest not being marked as ignored because I'm not sure if we should revisit the fact that we ignore these doctests or if we should just mark them as ignored (because of `target_feature(enable = "...")`).

Setting @fmease as reviewer as they are likely the only one with context about this issue. 😆

r? @fmease
…tch-1, r=nia-e

Reorder the methods in `#[rustc_must_implement_one_of]`

So that their order will be the preferred order for implementations (assuming implementing `read_buf()` is better), like @joshtriplett said in rust-lang#106643 (comment).

r? libs
This updates the rust-version file to f73951d.
Needed for the `__aeabi_u{read,write}*` symbols that we now require.
Cap socket send length to c_int::MAX on Apple targets

On Apple, `send`/`sendto` reject a length larger than `c_int::MAX` with `EINVAL` instead of doing a short send. The send length was only clamped to `wrlen_t::MAX` (a no-op on 64-bit unix), so writing more than `c_int::MAX` bytes to a socket failed on macOS.

Add a `MAX_SEND_LEN` cap (`c_int::MAX` on Apple, `wrlen_t::MAX` elsewhere), used in `write`, `send`, `send_to`, and `send_with_flags`.

Fixes rust-lang#115325
Account for desugaring in method call move errors

When encountering a move error caused by a desugared method call, talk about the user-facing feature (`await`/`?`/`for`-loop), instead of only the internal API it got desugared to.

```
error[E0382]: use of moved value: `entry`
  --> $DIR/moved-into-question-mark.rs:11:18
   |
LL |     for entry in fs::read_dir(".")? {
   |         ----- move occurs because `entry` has type `Result<DirEntry, std::io::Error>`, which does not implement the `Copy` trait
LL |
LL |         let file_type = entry?.file_type()?;
   |                         ------ `entry` moved due to usage in the question mark operator
...
LL |             dbg!(entry?.file_name());
   |                  ^^^^^ value used here after move
   |
note: the question mark operator is expanded into a call to `branch`, which takes ownership of the receiver `self`, which moves `entry`
  --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
help: you could `clone` the value and consume it, if the following trait bounds could be satisfied: `DirEntry: Clone` and `std::io::Error: Clone`
   |
LL |         let file_type = entry.clone()?.file_type()?;
   |                              ++++++++
```

Fix rust-lang#89567.
Update error message in documentation comments

Fixes the `library/core/src/fmt/mod.rs` item in the rust-lang#159751 issue.
…from`

* Add support for wrapping of the return value of delegation
* Cleanups
* Review: use `make_lang_item_qpath`
Fixes the builds of rustc and library/std for the L4Re target OS.
A major change was done in linking binaries: The need for the L4Bender
tool was removed and linking parameters are now fully configured in the
rustc target config.
Pull in a patch that landed just recently but hasn't yet been
backported. Without it, symcheck fails.

Link: llvm/llvm-project#214465
Advance to after the first regression in `hypot` but before the second
regression. See [1] for context on `hypot`.

[1]: rust-lang/compiler-builtins#1249
they projected into a scalable vector, which hits assertions
The current implementation assumed that powerpc64 glibc targets were all
using ELFv1. This really isn't very portable and I don't want to
hardcode a list of targets that are ELFv1, so we can instead just ask
rustc about the value of target_abi for this specific target to make it
work on all targets, even powerpc64-unknown-linux-gnuelfv2.
I've always referred to the crate as `symcheck` rather than
`symbol-check`; make this its actual name.
Generating the lockfile as part of the docker build means that we get a
new lockfile with the latest dependencies, even if our lockfile has
specific versions. The lockfile is checked in nowadays anyway, so remove
this generation step.

The lockfile for `builtins-test-intrinsics` was not yet checked in so
this is also done here.
2026-05-23 to 2026-05-24 includes a regression on aarch64, but this
seems to be in the setup code rather than the math code.

Link: rust-lang#160702
One version before the LLVM update.
jhpratt and others added 19 commits August 18, 2026 22:10
…=jackh726

Initial implementation of `FnPtr` trait

This commit is an initial implementation of the `FnPtr` trait as described in the `fn_static` tracking issue, which consists of moving the internally unstable `core::marker::FnPtr` to `core::ops::FnPtr`, as well as changing the API. Because `NonNull` is used in the new `as_ptr` signature, it was also turned into a proper lang item.

Part of `fn_static`: rust-lang#148768
std: use UNIX's `Instant` and `SystemTime` on Hermit

Since rust-lang#154234 already shares UNIX's internal `Timespec` abstraction, `Instant` and `SystemTime` are just very thin wrappers over that. This shouldn't change any behaviour.

CC @stepancheg
CC @stlankes @mkroening
…ejrs

Adding diagnostic item markers for multiple fs functions and structs

A couple months ago there were a good number of TOCTOU/other filesystem lint issues created by @estebank in the clippy repo such as:

* [`Path::metdata` after `Path::exists`](rust-lang/rust-clippy#17158)
* [opening multiple files under a directory without using `open_at`](rust-lang/rust-clippy#17156)
* [File deletion followed by file creation](rust-lang/rust-clippy#17153)
* [File path comparison without canonicalizing](rust-lang/rust-clippy#17155)
* [File creation followed by setting permissions](rust-lang/rust-clippy#17154)

(There are more TOCTOU/filesystem bug lints that could be made aside from the list above, e.g. with symlinks).

I was particularly interested in working on the last issue on file creation followed by setting permissions. However, I don't think I could start working on it without diagnostic items on filesystem functions like `fs::set_permissions` or `fs::create_dir_all`. I decided to put diagnostic item attributes on all the filesystem functions and a couple of the structs because they may be useful in creating clippy lints against TOCTOU bugs or other relevant filesystem operation bugs.
…r=oli-obk

Remove fields from TypeKind: Struct, Enum, Union and Tuple

Tracking issue rust-lang#146922

r? @oli-obk
…nthey

Assorted allocator nitpicks

Small things that got missed in rust-lang#157428, doc language cleanup for allocator, and a rename that closes rust-lang#158344. cc @rust-lang/wg-allocators. pending libs bikeshed decision on the naming of `into_raw_parts_with_alloc`

r? clarfonthey
Doc: clarify how `Read::bytes` handling Interrupted errors

Fixes rust-lang#161288
(cherry picked from commit 982c768)
* doc: list all remove_dir_all fallback targets
* doc: restore original TOCTOU phrasing for remove_dir_all fallback list

Keep the expanded platform list but drop the writer-facing "uses the fallback
implementation" wording per review, restoring the original reason phrasing that
explains protection is absent because the underlying platform lacks the required
support.

Co-authored-by: Md Muhtasim Munif Fahim <s1911024120@ru.ac.bd>
…loc-reenter-3, r=nia-e

Ensure TLS accesses don't call the global allocator through panic (part 3)

Follow-up to rust-lang#160976

Missed TLS code that is in a completely different module for some reason

cc rust-lang#160930
…move-dir-all-docs, r=aapoalas

doc: list all remove_dir_all fallback targets

This adds the still-missing 
emove_dir_all fallback targets to the TOCTOU warning and updates the wording to describe the current implementation detail directly.

Closes rust-lang#153781
vec: fixup the name that i forgot

Forgot this in rust-lang#161115. per libs decision in rust-lang#158344
@github-actions
github-actions Bot requested a review from a team as a code owner September 13, 2026 14:15
@feliperodri feliperodri added Maintenance Maintenance related issues for the challange rust Pull requests that update rust code labels Sep 13, 2026
@jrey8343

Copy link
Copy Markdown

The failures on this PR are not tool regressions: the subtree merge left unresolved conflict markers (<<<<<<< HEAD / >>>>>>> subtree/library) committed in 29 files under library/, starting with library/alloc/Cargo.toml and library/core/Cargo.toml (hence key with no value, expected \=`from cargo in every Kani job) andlibrary/alloc/src/lib.rs`. Full list:

library/alloc/Cargo.toml
library/alloc/src/lib.rs
library/core/Cargo.toml
library/core/src/alloc/layout.rs
library/core/src/convert/num.rs
library/core/src/ffi/c_str.rs
library/core/src/intrinsics/mod.rs
library/core/src/iter/adapters/cloned.rs
library/core/src/iter/adapters/fuse.rs
library/core/src/iter/adapters/map.rs
library/core/src/iter/adapters/map_windows.rs
library/core/src/iter/adapters/step_by.rs
library/core/src/iter/adapters/zip.rs
library/core/src/iter/range.rs
library/core/src/iter/traits/iterator.rs
library/core/src/mem/mod.rs
library/core/src/num/int_macros.rs
library/core/src/num/mod.rs
library/core/src/num/niche_types.rs
library/core/src/num/uint_macros.rs
library/core/src/ptr/mod.rs
library/core/src/ptr/non_null.rs
library/core/src/slice/iter.rs
library/core/src/slice/iter/macros.rs
library/core/src/slice/memchr.rs
library/core/src/slice/mod.rs
library/core/src/str/lossy.rs
library/core/src/str/pattern.rs
library/std/src/alloc.rs

In each block the HEAD side is this repo's verification additions (cfg(kani), safety contracts, mod verify) and the subtree/library side is the new upstream text; the two generally need to be combined rather than either side taken.

For what it is worth, the VecDeque changes in this update (the WrappedIndex newtype) rebase onto #681 cleanly once the tree compiles; I have that ready on my side.

- array/drain.rs: drop stale verify-rust-std imports (safety::requires,
  crate::iter::{TrustedLen, UncheckedIterator}, kani) left over from main;
  upstream rewrote Drain and no longer uses them, and UncheckedIterator is
  no longer re-exported from crate::iter.
- dec2flt/decimal_seq.rs: fix import ordering to satisfy rustfmt.
nightly-2026-08-21 makes implicit_provenance_casts deny-by-default in core.
Replace `self.end_or_len as usize` with `self.end_or_len.addr()` in the
verify-rust-std is_safe() invariant helpers for Iter/IterMut.
Dropped in error during conflict resolution. verify-rust-std's
#[requires(N > 0)] contract needs it: without it, map_windows is treated
as a const trait method and the contract wrapper's drop of `self` fails
with E0493 (destructor cannot be evaluated at compile-time). Upstream
omits it only because it has no contract.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Fixes the 23 remaining cfg(kani) compile errors surfaced once the merge
compiled (validated locally: rustc phase of `kani list` now passes):

- ptr/non_null.rs: NonNull.pointer is now a pattern type
  `(*const T) is !null`; raw-pointer ops (is_null/is_aligned/wrapping_offset/
  addr/as casts, can_dereference/same_allocation args) can't be called on it.
  Route field access through self.as_ptr()/result.as_ptr(); as_ptr's own
  contract uses transmute (mirrors body) to avoid self-reference.
- num/mod.rs: widening_mul now returns the full wide value, not (low, high);
  rewrite the harness to compare against the wide product directly.
- intrinsics/mod.rs: size_of is now a comptime fn; wrap the two runtime uses
  (a #[requires] and a harness closure) in const { size_of::<T>() }.
The 4 E0080 const-eval panics (core escape/SIMD const-assert guards tripped
by Kani over-monomorphization) reproduce only in CI, not locally (both
b07abe8 and ebed1d compile core clean in ~6min here). ebed1d is 2 commits
past b07abe8 on the same nightly-2026-08-21; pushing to let CI tell us
whether those commits change the outcome.
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 rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.