Skip to content

Rollup of 6 pull requests#154280

Closed
JonathanBrouwer wants to merge 21 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-6MPe4k9
Closed

Rollup of 6 pull requests#154280
JonathanBrouwer wants to merge 21 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-6MPe4k9

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

GuillaumeGomez and others added 21 commits March 17, 2026 22:53
This assertion and its comment are much visually heavier than the part of the
function that actually performs important work.

This assertion is also useless, because the `codegen_unit` query does not have
a `force_from_dep_node_fn` in its DepKindVTable, so the assertion would never
be reached even in the situation it is trying to guard against.

This assertion is also redundant, because we have plenty of incremental tests
that fail if the corresponding calls to `tcx.ensure_ok().codegen_unit(..)` are
removed.
In the serial compiler, we should never be trying to force a query node that
has a cached value, because we would have already marked the node red or green
when putting its value in cache.

In the parallel compiler, we immediately re-check the cache while holding the
state shard lock anyway, and trying to avoid that lock doesn't seem worthwhile.
The different parts of this function used to be split across different crates,
but nowadays they are both in `rustc_query_impl`, so they can be combined.

This commit also hoists the vtable lookup to a closure in
`make_dep_kind_vtable_for_query`, to reduce the amount of code that deals with
`GetQueryVTable`, and to make the inner function more consistent with other
functions in `execution`.
This effectively reverses <rust-lang@4284edc>.

At that time, I thought GetQueryVTable might be useful for other kinds of
static lookup in the future, but after various other simplifications and
cleanups that now seems less likely, and this style is more consistent with
other vtable-related functions.
This updates the rule names for shebang which were changed in
rust-lang/reference#2192 and
rust-lang/reference#2199.
The existing names have bugged me for a while. Changes:

- `CycleError` -> `Cycle`. Because we normally use "error" for a `Diag`
  with `Level::Error`, and this type is just a precursor to that. Also,
  many existing locals of this type are already named `cycle`.

- `CycleError::cycle` -> `Cycle::frames`. Because it is a sequence of
  frames, and we want to avoid `Cycle::cycle` (and `cycle.cycle`).

- `cycle_error` -> `find_and_handle_cycle`. Because that's what it does.
  The existing name is just a non-descript noun phrase.

- `mk_cycle` -> `handle_cycle`. Because it doesn't make the cycle; the
  cycle is already made. It handles the cycle, which involves (a)
  creating the error, and (b) handling the error.

- `report_cycle` -> `create_cycle_error`. Because that's what it does:
  creates the cycle error (i.e. the `Diag`).

- `value_from_cycle_error` -> `handle_cycle_error_fn`. Because most
  cases don't produce a value, they just emit an error and quit.
  And the `_fn` suffix is for consistency with other vtable fns.

- `from_cycle_error` -> `handle_cycle_error`. A similar story for this
  module.
…cfg, r=lolbinarycat

Fix `doc_cfg` not working as expected on trait impls

Fixes rust-lang#153655.

I spent waaaaay too much time on this fix. So the current issue is that rustdoc gets its items in two passes:
1. All items
2. Trait/blanket/auto impls

Because of that, the trait impls are not stored "correctly" in the rustdoc AST, meaning that the `propagate_doc_cfg` pass doesn't work correctly on them. So initially, I tried to "clean" the impls at the same time as the other items. However, it created a monstruous amount of bugs and issues and after two days, I decided to give up on this approach (might be worth fixing that in the future!). You can see what I tried [here](https://github.com/rust-lang/rust/compare/main...GuillaumeGomez:trait-impls-doc_cfg?expand=1).

So instead, since the impls are stored at the end, I create placeholders for impls and in `propagate_doc_cfg`, I store the `cfg` "context" (more clear when reading the code 😛) and re-use it later on when the "real" impl comes up.

r? @lolbinarycat
…=petrochenkov

Rename various query cycle things.

The existing names have bugged me for a while. Changes:

- `CycleError` -> `Cycle`. Because we normally use "error" for a `Diag` with `Level::Error`, and this type is just a precursor to that. Also, many existing locals of this type are already named `cycle`.

- `CycleError::cycle` -> `Cycle::frames`. Because it is a sequence of frames, and we want to avoid `Cycle::cycle` (and `cycle.cycle`).

- `cycle_error` -> `find_and_handle_cycle`. Because that's what it does. The existing name is just a non-descript noun phrase.

- `mk_cycle` -> `handle_cycle`. Because it doesn't make the cycle; the cycle is already made. It handles the cycle, which involves (a) creating the error, and (b) handling the error.

- `report_cycle` -> `create_cycle_error`. Because that's what it does: creates the cycle error (i.e. the `Diag`).

- `value_from_cycle_error` -> `handle_cycle_error_fn`. Because most cases don't produce a value, they just emit an error and quit. And the `_fn` suffix is for consistency with other vtable fns.

- `from_cycle_error` -> `handle_cycle_error`. A similar story for this module.

r? @petrochenkov
Clean up query-forcing functions

This PR takes the `force_query` function, inlines it into its only caller `force_from_dep_node_inner`, and renames the resulting function to `force_query_dep_node`. Combining the functions became possible after the removal of `rustc_query_system`, because they are now in the same crate.

There are two other notable cleanups along the way:

- Removing an unhelpful assertion and its verbose comment
  - The removed comment was originally added in rust-lang@0454a41, but is too verbose to be worth preserving inline.
- Removing a redundant cache lookup while forcing, as it is useless in the serial compiler and unnecessary (and probably unhelpful) in the parallel compiler

r? nnethercote
…aped, r=Urgau

 Fix invalid add of duplicated call locations for the rustdoc scraped examples feature

Fixes rust-lang#153837.

The bug was visible in the highlighting of the scrape examples code samples: the same part of the code was marked as "highlight" (by the scraped examples feature) twice, eventually leading to a wrong state of the HTML DOM status.

To fix the bug, I added a set to not re-add a location if it's already present.

r? @Urgau
…, r=oli-obk

enzyme submodule update

Brings a bugfix for EnzymeAD/Enzyme#2492, which had shown up in multiple independent Rust programs.

r? @oli-obk
Update books

## rust-embedded/book

1 commits in e88aa4403b4bf2071c8df9509160477e40179099..2463edeb8003c5743918b3739a9f6870b86396f5
2026-03-11 17:49:58 UTC to 2026-03-11 17:49:58 UTC

- Update teaching material duration for bare-metal Rust (rust-embedded/book#409)

## rust-lang/reference

7 commits in c49e89cc8c7c2c43ca625a8d5b7ad9a53a9ce978..7446bf9697c95d155eef33c6a9d91fbd29a5e359
2026-03-18 01:46:01 UTC to 2026-03-10 18:10:22 UTC

- Update `must_use` to use the attribute template (rust-lang/reference#1892)
- Add a rule that enum discriminants may not use generic parameters (rust-lang/reference#2206)
- Actually move out of Box in moving-out-of-Box test (rust-lang/reference#2204)
- Add special cases and links relating to dereferencing boxes (rust-lang/reference#2075)
- Move shebang into its own subchapter (rust-lang/reference#2199)
- Fields of enums and unions should be allowed to overlap (rust-lang/reference#2168)
- [type layout] Clarify size and alignment of pointers to unsized types (rust-lang/reference#2201)
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Mar 23, 2026
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend F-autodiff `#![feature(autodiff)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler 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 Mar 23, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=3

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 23, 2026

📌 Commit 32f246c has been approved by JonathanBrouwer

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 Mar 23, 2026
@JonathanBrouwer
Copy link
Contributor Author

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

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 23, 2026
Rollup of 6 pull requests


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
@JonathanBrouwer
Copy link
Contributor Author

Created the rollup early to run the try jobs, feel free to recreate this rollup if a lot of new rollupable prs enter the queue

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 24, 2026

☀️ Try build successful (CI)
Build commit: 4550011 (455001173663e99f88559b5204a5f8778a8cd6c9, parent: f66622c7eca7fc48ccc4dac848ff911b09a4d566)

@Zalathar
Copy link
Member

Created the rollup early to run the try jobs, feel free to recreate this rollup if a lot of new rollupable prs enter the queue

I plan to make a larger rollup (6 → 10), but I'll hold off for a bit while the current rollup=never job runs, in case we see even more approvals within the next hour or so.

@jhpratt
Copy link
Member

jhpratt commented Mar 24, 2026

I did the n=10 PR (#154289), but feel free to override it. That's generally around my threshold for where we don't want larger rollups anyways.

@jhpratt jhpratt closed this Mar 24, 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 Mar 24, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 24, 2026

This pull request was unapproved due to being closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend F-autodiff `#![feature(autodiff)]` 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-compiler Relevant to the compiler 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.

8 participants