Skip to content

Rollup of 28 pull requests#157735

Closed
jhpratt wants to merge 83 commits into
rust-lang:mainfrom
jhpratt:rollup-CXQDxvK
Closed

Rollup of 28 pull requests#157735
jhpratt wants to merge 83 commits into
rust-lang:mainfrom
jhpratt:rollup-CXQDxvK

Conversation

@jhpratt

@jhpratt jhpratt commented Jun 11, 2026

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

Mark-Simulacrum and others added 30 commits April 10, 2026 12:28
On some platforms, it looks like these are not currently Send/Sync. We
have a negative impl in env/common.rs. This is a breaking change on a
bunch of targets, but it makes it less likely that someone
unintentionally/accidentally depends on this. This is a potentially
partial list but should be fairly complete:

aarch64-unknown-none, aarch64-unknown-none-softfloat, armv7a-none-eabi,
armv7a-none-eabihf, armv7r-none-eabi, armv7r-none-eabihf,
armv8r-none-eabihf, loongarch64-unknown-none,
loongarch64-unknown-none-softfloat, nvptx64-nvidia-cuda,
riscv32i-unknown-none-elf, riscv32im-unknown-none-elf,
riscv32imac-unknown-none-elf, riscv32imafc-unknown-none-elf,
riscv32imc-unknown-none-elf, riscv64gc-unknown-none-elf,
riscv64imac-unknown-none-elf, s390x-unknown-none-softfloat,
thumbv6m-none-eabi, thumbv7a-none-eabi, thumbv7a-none-eabihf,
thumbv7em-none-eabi, thumbv7em-none-eabihf, thumbv7m-none-eabi,
thumbv7r-none-eabi, thumbv7r-none-eabihf, thumbv8m.base-none-eabi,
thumbv8m.main-none-eabi, thumbv8m.main-none-eabihf,
thumbv8r-none-eabihf, wasm32-unknown-unknown, wasm32v1-none,
x86_64-unknown-none
WF-checking walks through higher-ranked binders without instantiating
them, so a `dyn Trait` nested inside a `for<'a>` bound reaches the
`ty::Dynamic` arm of `WfPredicates::visit_ty` while still carrying
escaping bound vars. Feeding that type into
`ExistentialTraitRef::with_self_ty` violated its no-escaping-self
precondition and tripped the assertion that guards it.

The trait ref built there is only used to read off `ConstArgHasType`
clauses, which constrain the trait's own const arguments and never
mention the `Self` type. Substitute a fresh placeholder self type when
the real one escapes: the assertion holds and the const-argument check
is still performed. Re-enable the `with_self_ty` debug assertion now
that its precondition is upheld.
One test covers the original ICE (a `dyn Trait` nested in a `for<'a>`
bound, distilled from itertools). The other locks in that a const
argument on such a nested `dyn` is still type-checked, so the
placeholder-self-type fix cannot silently regress into dropping the
`ConstArgHasType` check.
The in-memory dep graph kept for `-Zquery-dep-graph` is built by
`GraphEncoder::record`, which pushed each node using `try_lock` and
silently dropped the node when the lock was contended. Single-threaded
the only contention is a query forced re-entrantly from within
`with_retained_dep_graph`, so dropping was harmless. Under the parallel
frontend several encoder threads record nodes at the same time, so a
contended `try_lock` dropped nodes and edges at random, leaving the
retained graph nondeterministic and making the dep-graph ui tests, which
assert on its contents, fail intermittently.

Remove that reentrancy in `check_paths`: read the graph into owned
results while the lock is held, then emit the diagnostics afterwards.
The only query forced inside the old closure was `def_path_str` (for the
error messages), which can create dep nodes and re-enter the encoder;
doing the emission after the lock is released means `record` never
re-enters while the lock is held. `record` can then block on the lock
unconditionally instead of using `try_lock`, so concurrent encoders
never drop a node or edge.

This only affects compilation with `-Zquery-dep-graph`; with the flag
off the retained graph is absent and nothing changes.
These tests assert on the contents of the retained dep graph, which is now
built deterministically under the parallel frontend, so they no longer need
to be ignored there. Replace the ignore-parallel-frontend directives with
blank lines rather than deleting them, so the following line numbers stay the
same and the expected output is unchanged.
And rename a struct field.
This gets rid of the `printable.py` script,
ensuring that `unicode-table-generator` handles all our
Unicode data table generation needs.

I've elected to give each Unicode property its own table,
instead of merging them all into one.
This is slightly less efficient in terms of space,
but should allow us to expose these tables in the future
with public methods on `char`.
These characters may be hidden/invisible otherwise.
jhpratt added 7 commits June 10, 2026 22:57
…r=petrochenkov

compiletest: ignore SVG `y` offset in by-lines comparison

Tracked in rust-lang#154314.
Closes rust-lang#157606

SVG diagnostic snapshots render one terminal row per line, laid out top to bottom. Under the parallel front-end, independent diagnostics can be emitted in a different order. That permutes the rows and re-renders each one at a different vertical `y` offset, even though the content of every row is unchanged.

This change strips the `y` coordinate (and the `<svg>` header line, whose width and height are already ignored by the exact comparison) before the multiset comparison, so a reordering of whole rows is no longer treated as a difference.
Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs

This PR builds on [peterjoel's introduction of `or_try_*` variants for `HashMap`](rust-lang#120708) from the following [ACP](rust-lang/libs-team#336) Peter made.

The tracking issue for this PR is [here](rust-lang#157354).
…=fmease

Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`

Fixes: rust-lang#157565

### Description
A diagnostics improvement rust-lang#84896 in 2015 edition caused errors when `dyn + dyn` was used, even though `dyn` is a contextual keyword in the 2015 edition.

### Solution
A check was added in `rustc_parse/src/parser/ty.rs:1095`:
```rust
            if self.token.is_keyword(kw::Dyn) && self.token.span.edition().at_least_rust_2018() {
```
This checks that the version is not 2015 before throwing an error.
A regression test was also added, in `tests/ui/parser/dyn-2015-identifier.rs`
… r=JonathanBrouwer

Rename `errors.rs` file to `diagnostics.rs` (4/N)

Follow-up of rust-lang#157485.

r? @JonathanBrouwer
…t, r=petrochenkov

Move symbol hiding code to a new file

Move the symbol visibility editing code (`apply_hide` and helpers) from
`archive.rs` into a new `symbol_edit.rs` module.

This is a pure code move with no functional changes — extracted to reduce
the size of `archive.rs` and to provide a natural home for future symbol
editing logic (e.g. renaming, rust-lang#156950).

Requested in rust-lang#156950 (comment).

r? @petrochenkov
…2, r=JonathanBrouwer

Rename `errors.rs` file to `diagnostics.rs` (5/N)

Follow-up of rust-lang#157485.

r? @JonathanBrouwer
…apin

Fix doc link to Instant sub in saturating caveat

The `sub` link in the caveat about saturating subtraction for `Instant` was linking to the wrong implementation of `sub`. On https://doc.rust-lang.org/std/time/struct.Instant.html it was linking to `Instant - Duration` which in fact *is not saturating*, and *will* panic. It should link to `Instant - Instant`.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 11, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jun 11, 2026
@jhpratt

jhpratt commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f6a4912 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 11, 2026
@jhpratt jhpratt closed this Jun 11, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 11, 2026
@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 11, 2026
@jhpratt jhpratt deleted the rollup-CXQDxvK branch June 11, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.