Skip to content

Rollup of 15 pull requests#157673

Closed
GuillaumeGomez wants to merge 40 commits into
rust-lang:mainfrom
GuillaumeGomez:rollup-YL5cqtn
Closed

Rollup of 15 pull requests#157673
GuillaumeGomez wants to merge 40 commits into
rust-lang:mainfrom
GuillaumeGomez:rollup-YL5cqtn

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

traviscross and others added 30 commits May 20, 2026 20:34
The `TypeOutlives` handler in `evaluate_predicate_recursively` means
to check whether a type in a `T: 'a` predicate has free regions,
bound regions, non-region inference variables, or non-region generic
parameters -- and if so, to return `EvaluatedToOkModuloRegions`
rather than `EvaluatedToOk`.  Correspondingly, the comment says "no
free lifetimes or generic parameters".  But the code was mistakenly
checking `has_non_region_infer()` twice instead of checking both
`has_non_region_infer()` and `has_non_region_param()`.

This meant that `TypeOutlives(T, 'static)` where `T` is
a type parameter returned `EvaluatedToOk` -- claiming the
result holds unconditionally -- when the correct answer is
`EvaluatedToOkModuloRegions`.

The distinction matters during marker trait
winnowing in `prefer_lhs_over_victim`, which uses
`must_apply_considering_regions()` (true only for `EvaluatedToOk`)
to decide whether one impl beats another when there are multiple
candidates.  With the bug, a `T: 'static`-bounded impl appeared
equally as strong as an unrestricted impl, making the winner
depend on source order.  This caused spurious E0310 errors
when the more-constrained impl happened to appear after the
less-constrained one.

This fixes Rust issue 109481.  See PR 153847.

This same symptom was originally filed as issue 84917 and fixed in PR
88139.  Then PR 102472 rewrote the `TypeOutlives` handler, introducing
the duplicate `has_non_region_infer()` and losing the param check,
regressing this.  Around this same time, issue 109481 was filed.  It
noted the connection to PR 102472 -- that the bug only appeared after
it -- but the duplicate condition was not noticed.
It's harder than one would imagine to demonstrate that the
`has_non_region_infer()` check in the `TypeOutlives` handler is
load bearing (even though the check seems right analytically).
Fortunately, we did find a way to show this.  Let's add that test.

In working that out, we found two other interesting ways of showing
that the `has_non_region_param()` check matters.  Let's add those too.

Though we're concerned here with code in the old solver, we test
against both.
Since approx. Windows SDK 20348, the corresponding cdb (and/or its
underlying WinDbg engine) changed or regressed the `OsStr`/`OsString`
visualization, and no longer renders the emoji. Since approx. SDK/cdb
26100, the output formatting of the string containing UTF-8 (i.e. the
multi-byte emoji grapheme) seems to have further regressed (e.g. the end
quotation mark is no longer shown and command output becomes garbled).

Relevant issues:

* RUST-88840
* RUST-148743
* RUST-88796
The hand-written reader bootstrap.py uses to find the stage0 cargo and
rustc only recognized `[table]` headers, so dotted keys like
`build.cargo = "..."` were ignored. Parse the dotted prefix on each key
as the table it belongs to, resolved relative to the enclosing section,
and scope the cargo/rustc lookup to `[build]` so the Python and Rust
sides agree.
This makes a few changes to rustc_public to make it a little easier to
analyze ADT types.

* It implements `CrateDef` and `CrateDefType` for `FieldDef`, which
  allows easy access to the underlying `DefId`, names, and tool
  annotations.
* It adds `Crate::adts` to simplify stepping through all the ADTs in the
  crate.

Note that I did use Gemini to assist with writing this patch, but I
wrote most of it, reviewed all the vode, and verified the tests pass
locally.
Moreover, flesh out the rustdoc book section about code block attributes.
* Fix async drop glue for Box<T>
* Adress reviewer concerns
* Address more concerns
Incorrect types can't cause unsafety and making it untyped will make it
easier to get rid of the ProcMacro enum in the proc-macro ABI.
Instead encode this information in the crate metadata. This helps shrink
the proc-macro ABI to just the parts necessary for transmitting raw
bytes to perform RPC on top of.
…keys, r=clubby789

bootstrap: Handle dotted table keys when parsing bootstrap.toml

Fixes rust-lang#156948

`bootstrap.py` has a small hand-rolled reader that pulls the stage0 cargo and rustc out of `bootstrap.toml` before the real TOML parser is built. It only understood `[table]` headers, so the dotted form that `bootstrap.example.toml` now uses (`build.cargo = "..."`) was silently dropped, and the cargo/rustc lookup matched those keys in any table rather than only `[build]`.

Teach the reader to strip an optional dotted prefix and treat it as the key's table, the same way `configure.py` does when it writes the file, and scope the cargo/rustc lookup to `[build]`. New tests cover the dotted form, equivalence with the section form, wrong-table rejection, and dotted target keys.

*Disclosure: the code was written by AI (Claude); reviewed and tested by me.*
…db, r=Kobzol

Disable `tests/debuginfo/pretty-std.rs` `OsString` cdb check

## Summary

Since approx. Windows SDK 20348, the corresponding cdb (and/or its underlying WinDbg engine) changed or regressed the `OsStr`/`OsString` visualization, and no longer renders the emoji. Since approx. SDK/cdb 26100, the output formatting of the string containing UTF-8 (i.e. the multi-byte emoji grapheme) seems to have further regressed (e.g. the end quotation mark is no longer shown and command output becomes garbled).

Relevant issues:

* rust-lang#88840
* rust-lang#148743
* rust-lang#88796

This was failing for me locally on host Windows MSVC under `./x test tests/debuginfo`. And the issues re. this case failing has been open for a long while and have not been addressed, so I propose disabling this case.

I believe this is either a regression or a change in cdb and/or the underlying WinDbg. I have not bothered filing such a cdb bug report, I don't know enough about this.

The check was actually relaxed to not require the emoji to be rendered properly in the output in rust-lang#88842, but I feel like that regressed the original intention of the check (that multi-byte Unicode graphemes are properly rendered), so I just restored the original checks but commented them out.

Maybe r? @wesleywiser (or compiler)
…trochenkov

Remove ProcMacro enum from proc macro ABI

Instead encode this information in the crate metadata. This helps shrink the proc-macro ABI to just the parts necessary for transmitting raw bytes to perform RPC on top of.

r? @petrochenkov cc @cyrgani
…test-harness, r=GuillaumeGomez

rustdoc: Test & document `test_harness` code block attribute

They were fully untested and undocumented previously despite being stable.
Context: [#t-rustdoc > &rust-lang#96;test_harness&rust-lang#96; langstr @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/.60test_harness.60.20langstr/near/546748038).

While at it, I've also improved the documentation for code block attributes in general.
I was only inspired to do so because there was no good place for `test_harness` and because it got hard to skim due to a lack of subsubsections.
…ssing-param-check, r=lcnr

Fix marker trait winnowing depending on impl order

Story: I was looking through this code for an unrelated reason and happened to notice the duplicate condition.  That seemed obviously wrong, especially in light of the comment, so I worked backward to what it affected, wrote a test that failed, and then found that the test matched an existing `known-bug` test, which pointed me to rust-lang#109481.

---

The `TypeOutlives` handler in `evaluate_predicate_recursively` means to check whether a type in a `T: 'a` predicate has free regions, bound regions, non-region inference variables, or non-region generic parameters -- and if so, to return `EvaluatedToOkModuloRegions` rather than `EvaluatedToOk`.  Correspondingly, the comment says "no free lifetimes or generic parameters".  But the code was mistakenly checking `has_non_region_infer()` twice instead of checking both `has_non_region_infer()` and `has_non_region_param()`.

This meant that `TypeOutlives(T, 'static)` where `T` is a type parameter returned `EvaluatedToOk` -- claiming the result holds unconditionally -- when the correct answer is `EvaluatedToOkModuloRegions`.

The distinction matters during marker trait winnowing in `prefer_lhs_over_victim`, which uses `must_apply_considering_regions()` (true only for `EvaluatedToOk`) to decide whether one impl beats another when there are multiple candidates.  With the bug, a `T: 'static`-bounded impl appeared equally as strong as an unrestricted impl, making the winner depend on source order.  This caused spurious E0310 errors when the more-constrained impl happened to appear after the less-constrained one.

Fixes rust-lang#109481.

This same symptom was originally filed as rust-lang#84917 and fixed in PR rust-lang#88139.  Then PR rust-lang#102472 rewrote the `TypeOutlives` handler, introducing the duplicate `has_non_region_infer()` and losing the param check, regressing this. Around this same time, rust-lang#109481 was filed.  It noted the connection to rust-lang#102472 -- the bug only appeared after it -- but the duplicate condition was not noticed.

r? @lcnr

cc @oli-obk @nikomatsakis
…nder-fix, r=GuillaumeGomez

Reorder `impl` restriction rendering and add bottom margin

This PR moves the `impl` restriction rendering above the trait description.
It also adds an ⓘ marker, italicizes the text, and adds a bottom margin.
Tracking issue: rust-lang#105077

before:
<img width="1108" height="651" alt="image" src="https://github.com/user-attachments/assets/520d95cf-a648-44e7-8036-e453cfbdf569" />

after:
<img width="1085" height="671" alt="image" src="https://github.com/user-attachments/assets/84493e56-6227-433b-93d0-4fcbe28ac00c" />

r? @GuillaumeGomez
cc @Urgau @jhpratt
…ering, r=fmease

Report duplicate relaxed bounds during ast lowering

Instead of during hir-ty-lowering.

Not sure it is worth erroring on at all, but it's better to do it directly during lowering instead of collecting bounds after the fact.
fix doc for unicode normalization faq on `casefold` APIs

APIs added in rust-lang#154742 have an outbound doc link to https://www.unicode.org/faq/normalization, but this URL appears to not exist.

The correct URL appears to be https://www.unicode.org/faq/normalization.html

cc @Jules-Bertholet
…=jieyouxu

Update to ar_archive_writer v0.5.2

This includes rust-lang/ar_archive_writer#32 and rust-lang/ar_archive_writer#33. The former fixes a panic when there are more than 64k archive members.
…haustively, r=lqd

Add test for matches in `rustc_must_match_exhaustively`

r? @lcnr
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 9, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-js Area: Rustdoc's JS front-end 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-rust-analyzer Relevant to the rust-analyzer 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 9, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

📌 Commit cc98143 has been approved by GuillaumeGomez

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 9, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-2

@rust-bors

rust-bors Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit cc98143 with merge 0060cc7

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/27221255971

rust-bors Bot pushed a commit that referenced this pull request Jun 9, 2026
Rollup of 15 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@jhpratt

jhpratt commented Jun 9, 2026

Copy link
Copy Markdown
Member

added a couple more PRs to the rollup to hopefully clear the queue sooner

@jhpratt jhpratt closed this Jun 9, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 9, 2026
@rust-bors

rust-bors Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@GuillaumeGomez GuillaumeGomez deleted the rollup-YL5cqtn branch June 9, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-js Area: Rustdoc's JS front-end 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-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-rust-analyzer Relevant to the rust-analyzer 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.