Rollup of 15 pull requests#158508
Open
jhpratt wants to merge 128 commits into
Open
Conversation
If someone considers moving from `option.into_iter().flatten()` to `option.into_flat_iter()`, it may be important for performance that this iterator "specializes" methods the same way `Flatten` does, especially forwarding to underlying `fold`, etc.
This updates the rust-version file to 029c9e1.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@029c9e1 Filtered ref: rust-lang/stdarch@b914e70 Upstream diff: rust-lang/rust@045b177...029c9e1 This merge was created using https://github.com/rust-lang/josh-sync.
Rustc pull update
Correct some wrong uses of LLVM intrinsics
The CRC[C].W.{B,H}.W only consume the low 8/16 bits of the input operand.
The previous unsigned cast was a workaround for Miri's software
implementation.
Miri now masks the inputs to match hardware semantics, and LLVM will
learn the demanded-bits property of CRC intrinsics, so the explicit
zero-extension is no longer required.
Update rand to 0.9.3 to fix `GHSA-cq8v-f236-94qc`
Stabilize LoongArch CRC Intrinsics
loongarch: Remove explicit zero-extension from CRC[C].W.{B,H}.W
We still only support `PROT_READ|PROT_WRITE`, so `mprotect` is a no-op other than validating arguments. We only implement `madvise` for the hints that can be ignored without a change in semantic (e.g. no `MADV_DONTNEED`, so it is also a no-op other than validating arguments.
These intrinsics need `Arguments_Preparation` added so that the intrinsic-test tool knows to generate const arguments.
These intrinsics need `Arguments_Preparation` added so that the intrinsic-test tool knows to generate const arguments.
Clang uses the `llvm.aarch64.sve.rev.bN` intrinsic for `svrev` with `b16`, `b32` and `b64`. This required small generator changes so it knew a bool-to-bool conversion was a no-op and a new blanket identity impl of `SveInto` so the calls generated compile.
Clang uses the `llvm.aarch64.sve.zip.bN` intrinsic for `svzip` with `b16`, `b32` and `b64` and the `llvm.aarch64.sve.uzp.bN` intrinsic for `svuzp` with the same types.
Forward addl. arguments to `intrinsic-test.sh` to `cargo test` so that `--no-fail-fast` or a specific test name can be passed.
…e-sve update `arm_intrinsics.json` for `svset` and `svget`
intrinsic-test: fwd args in `intrinsic-test.sh`
…on-svrev-svzip-svuzp core_arch: redefine `svrev`, `svzip` and `svuzp`
This updates the rust-version file to 8e15021.
…otriddle rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs This is a generalization of rust-lang#92940: that PR handled cases like `impl Foreign for Box<Local>`, but was missing handling for a few other closely related cases. My particular interest was with showing `impl From<Box<Utf8Path>> for Box<Path>` in camino's documentation. But I ended up handling a bunch of related cases along the way. I'm new to rustdoc so please let me know if I got anything wrong :) took a bit to fully understand how this worked. <img width="1733" height="483" alt="image" src="https://github.com/user-attachments/assets/4b987c61-bdac-4de3-a491-c0577e06fa7c" />
miri subtree update Subtree update of `miri` to rust-lang/miri@97eec7c. Created using https://github.com/rust-lang/josh-sync. r? @ghost
…oboet Expand `OptionFlatten`'s iterator methods If someone considers moving from `option.into_iter().flatten()` to `option.into_flat_iter()`, it may be important for performance that this iterator "specializes" methods the same way `Flatten` does, especially forwarding to underlying `fold`, etc.
…=Kivooeo Move tests drop Hi, moved some tests for drop and the dropck, part of rust-lang#133895 r? @Kivooeo
… r=nnethercote,Kivooeo perf: drop the full-crate AST walk in check_unused
…y-count, r=petrochenkov Fix too-short variance slice in `variances_of` cycle recovery This changes the cycle-error fallback in `variances_of` to size the slice the same way the provider does in [`variance/solve.rs:117`](https://github.com/rust-lang/rust/blob/32ea3615cc027bcb8fd720c7511ffb484f6223a3/compiler/rustc_hir_analysis/src/variance/solve.rs#L117). This can otherwise ICE under the parallel frontend in `relate_args_with_variances` for items that inherit their generics from a parent (like a tuple struct constructor). See rust-lang#154560 (comment)
…rget, r=JonathanBrouwer Allow the unstable attribute on foreign type While working the `FnPtr` trait in rust-lang#156176 @carbotaniuman was trying to implement `Code` as an extern type but got an error as the current stability infrastructure does not allow `unstable` attribute on foreign type. rust-lang#158200 This PR fixes that by allowing the `unstable` attribute on ForeignTy and adds test to verify. @rustbot r? @JonathanBrouwer
…s, r=jhpratt
Fix inconsistent safety requirement in VecDeque::nonoverlapping_ranges
The safety documentation of `nonoverlapping_ranges` says that its `head` argument must be in bounds:
```rust
/// Get source, destination and count (like the arguments to [`ptr::copy_nonoverlapping`])
/// for copying `count` values from index `src` to index `dst`.
/// One of the ranges can wrap around the physical buffer, for this reason 2 triples are returned.
///
/// Use of the word "ranges" specifically refers to `src..src + count` and `dst..dst + count`.
///
/// # Safety
///
/// - Ranges must not overlap: `src.abs_diff(dst) >= count`.
/// - Ranges must be in bounds of the logical buffer: `src + count <= self.capacity()` and `dst + count <= self.capacity()`.
/// - `head` must be in bounds: `head < self.capacity()`.
#[cfg(not(no_global_oom_handling))]
unsafe fn nonoverlapping_ranges(
&mut self,
src: usize,
dst: usize,
count: usize,
head: usize,
) -> [(*const T, *mut T, usize); 2] {
```
However, this is slightly stricter than the `VecDeque` internal invariant for `head`. The struct-level invariant allows `head == 0` when the buffer capacity is zero:
```rust
pub struct VecDeque<
T,
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
> {
// `self[0]`, if it exists, is `buf[head]`.
// `head < buf.capacity()`, unless `buf.capacity() == 0` when `head == 0`.
head: WrappedIndex,
// the number of initialized elements, starting from the one at `head` and potentially wrapping around.
// if `len == 0`, the exact value of `head` is unimportant.
// if `T` is zero-Sized, then `self.len <= usize::MAX`, otherwise `self.len <= isize::MAX as usize`.
len: usize,
buf: RawVec<T, A>,
}
```
This zero-capacity case is reachable through the public API. I create the corresponding case in [Rustplayground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=c1632f2a9170264c3ae50f6c229027db). This case can run without UB, also Miri runs successfully.
So it seems that the safety documentation of `VecDeque::nonoverlapping_ranges` is incorrect, or this API should add additional processing to approach this condition. This PR provides the minimal fix: updates the safety documentation for `nonoverlapping_ranges` to match the existing VecDeque invariant.
If needed, I can add a debug_assert! to check whether the input satisfies the requirement.
No behavior is changed.
Reorganize `tests/ui/issues` [15/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) r? Kivooeo @Teapot4195
…itions, r=GuillaumeGomez Upgrade `jsonsocck` and `jsondoclint` to edition 2024. No code changes were necessary to perform the upgrade. I used `cargo fix --edition`, and additionally had an AI tool review the source code against the [Rust 2024 edition guide](https://github.com/rust-lang/edition-guide/tree/master/src/rust-2024) and the [edition upgrade guide](https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html) to ensure the change works properly. r? @GuillaumeGomez **AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
…ot4195,Kivooeo Reorganize `tests/ui/issues` [16/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) Also moved one test from `span/` as it is part of `28498` r? Kivooeo @Teapot4195
…-types-edition, r=GuillaumeGomez Upgrade `rustdoc-json-types` to 2024 edition. No code changes were necessary to perform the upgrade. I used `cargo fix --edition`, and additionally had an AI tool review the source code against the [Rust 2024 edition guide](https://github.com/rust-lang/edition-guide/tree/master/src/rust-2024) and the [edition upgrade guide](https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html) to ensure the change works properly. Same approach as in rust-lang#158470. I don't believe this will raise the MSRV of `rustdoc-types`, because [its MSRV is already 1.85](https://crates.io/crates/rustdoc-types) which [supports the 2024 edition](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/). r? @GuillaumeGomez **AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
Member
Author
|
@bors r+ rollup=never p=5 |
Contributor
Contributor
|
⌛ Testing commit 2f26f3a with merge fd07dbf... Workflow: https://github.com/rust-lang/rust/actions/runs/28309034190 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 28, 2026
Rollup of 15 pull requests Successful merges: - #158497 (stdarch subtree update) - #152225 (Add supertrait item shadowing for type-level path resolution) - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs) - #158501 (miri subtree update) - #153097 (Expand `OptionFlatten`'s iterator methods) - #157614 (Move tests drop) - #157996 (perf: drop the full-crate AST walk in check_unused) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158433 (Fix inconsistent safety requirement in VecDeque::nonoverlapping_ranges) - #158464 (Reorganize `tests/ui/issues` [15/N]) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158485 (Reorganize `tests/ui/issues` [16/N]) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
OptionFlatten's iterator methods #153097 (ExpandOptionFlatten's iterator methods)variances_ofcycle recovery #158163 (Fix too-short variance slice invariances_ofcycle recovery)tests/ui/issues[15/N] #158464 (Reorganizetests/ui/issues[15/N])jsonsocckandjsondoclintto edition 2024. #158470 (Upgradejsonsocckandjsondoclintto edition 2024.)tests/ui/issues[16/N] #158485 (Reorganizetests/ui/issues[16/N])rustdoc-json-typesto 2024 edition. #158488 (Upgraderustdoc-json-typesto 2024 edition.)r? @ghost
Create a similar rollup