Skip to content

Rollup of 15 pull requests#158508

Open
jhpratt wants to merge 128 commits into
rust-lang:mainfrom
jhpratt:rollup-FKOfwV9
Open

Rollup of 15 pull requests#158508
jhpratt wants to merge 128 commits into
rust-lang:mainfrom
jhpratt:rollup-FKOfwV9

Conversation

@jhpratt

@jhpratt jhpratt commented Jun 28, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

cuviper and others added 30 commits February 25, 2026 09:20
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.
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.
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.
jhpratt added 12 commits June 27, 2026 22:13
…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" />
…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.
…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.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 28, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustdoc-json Area: Rustdoc JSON backend A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jun 28, 2026
@jhpratt

jhpratt commented Jun 28, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2f26f3a has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 28, 2026
@rust-bors

rust-bors Bot commented Jun 28, 2026

Copy link
Copy Markdown
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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustdoc-json Area: Rustdoc JSON backend A-tidy Area: The tidy tool rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.