Rollup of 6 pull requests#154280
Conversation
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)
|
@bors r+ rollup=never p=3 |
|
Trying commonly failed jobs |
This comment has been minimized.
This comment has been minimized.
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
|
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. |
|
I did the |
|
This pull request was unapproved due to being closed. |
Successful merges:
doc_cfgnot working as expected on trait impls #153964 (Fixdoc_cfgnot working as expected on trait impls)r? @ghost
Create a similar rollup