Uh oh!
There was an error while loading. Please reload this page.
delegation: fix cycles during delayed lowering - #154368
Conversation
petrochenkov
commented
Mar 25, 2026
What specific uses of |
petrochenkov
commented
Mar 26, 2026
jyn514
commented
Mar 26, 2026
This should really have a reviewer with a lot of query system experience. r? @Zoxc |
rustbot
commented
Mar 26, 2026
Failed to set assignee to
|
This comment has been minimized.
This comment has been minimized.
f32739b to
f50159fCompare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f50159f to
5afd6e4Compareaerooneqq
commented
Mar 27, 2026
So the reason of this cycle was that this function wants to iterate over all free items, however they were not available during delayed lowering as it was executed before rust/compiler/rustc_middle/src/ty/print/pretty.rs Line 3393 in e3691a5 Next, there is one more problem in this function, which is maybe not that actual now, but it will be during supporting inherent impls, as during function resolution we will do coherence check, and in cases like: structX<T>{t:T}// No generics providedimplX{pubfnfoo(){}}
reuse X::foo;we would still come to rust/compiler/rustc_middle/src/ty/print/pretty.rs Line 3398 in e3691a5 @rustbot ready |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@rustbot ready |
petrochenkov
commented
Mar 27, 2026
@bors try @rust-timer queue |
aerooneqq
commented
Apr 9, 2026
@rustbot ready |
petrochenkov
commented
Apr 9, 2026
@bors r+ |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 4c42051 (parent) -> a87c9b9 (this PR) Test differencesShow 28 test diffsStage 1
Stage 2
Additionally, 26 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard a87c9b96031d4d8698bb0cd6533e83bc6d77ddaa --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
rust-timer
commented
Apr 9, 2026
Finished benchmarking commit (a87c9b9): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 6.5%, secondary 5.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.441s -> 489.938s (0.10%) |
matthiaskrgr
commented
Apr 11, 2026
looks like doc memory regressed quite a bit ![]() |
…ms-revert, r=petrochenkov delegation: revert execution of hir_crate_items before delayed lowering This PR reverts rust-lang#154368, as after weekend consideration I don't think that it is a correct way of fixing cycles during delayed lowering: - The number of ICEs were reported, fixing them would require to develop solution from rust-lang#154368 but I am afraid that it would lead to cancer code growing, - The [memory regression](rust-lang#154368 (comment)) for rustdoc was reported, it can be fixed with moving `tcx.force_delayed_owners_lowering` call earlier, but it is already bad that this is call is now required everywhere, before rust-lang#154368 AST was dropped before `hir_crate_items` automatically and users of `rustc` API did not have to think about it. I will try to come up with a more robust solution leaving rust-lang#154368 as a last resort if nothing else will work. Re-opens rust-lang#154169. Fixesrust-lang#155125. Fixesrust-lang#155127. Fixesrust-lang#155128. Fixesrust-lang#155164. Fixesrust-lang#155202. Part of rust-lang#118212. r? @petrochenkov
…ms-revert, r=petrochenkov delegation: revert execution of hir_crate_items before delayed lowering This PR reverts rust-lang#154368, as after weekend consideration I don't think that it is a correct way of fixing cycles during delayed lowering: - The number of ICEs were reported, fixing them would require to develop solution from rust-lang#154368 but I am afraid that it would lead to cancer code growing, - The [memory regression](rust-lang#154368 (comment)) for rustdoc was reported, it can be fixed with moving `tcx.force_delayed_owners_lowering` call earlier, but it is already bad that this is call is now required everywhere, before rust-lang#154368 AST was dropped before `hir_crate_items` automatically and users of `rustc` API did not have to think about it. I will try to come up with a more robust solution leaving rust-lang#154368 as a last resort if nothing else will work. Re-opens rust-lang#154169. Fixesrust-lang#155125. Fixesrust-lang#155127. Fixesrust-lang#155128. Fixesrust-lang#155164. Fixesrust-lang#155202. Part of rust-lang#118212. r? @petrochenkov
Rollup merge of #155226 - aerooneqq:delegation-hir-crate-items-revert, r=petrochenkov delegation: revert execution of hir_crate_items before delayed lowering This PR reverts #154368, as after weekend consideration I don't think that it is a correct way of fixing cycles during delayed lowering: - The number of ICEs were reported, fixing them would require to develop solution from #154368 but I am afraid that it would lead to cancer code growing, - The [memory regression](#154368 (comment)) for rustdoc was reported, it can be fixed with moving `tcx.force_delayed_owners_lowering` call earlier, but it is already bad that this is call is now required everywhere, before #154368 AST was dropped before `hir_crate_items` automatically and users of `rustc` API did not have to think about it. I will try to come up with a more robust solution leaving #154368 as a last resort if nothing else will work. Re-opens #154169. Fixes#155125. Fixes#155127. Fixes#155128. Fixes#155164. Fixes#155202. Part of #118212. r? @petrochenkov
…, r=petrochenkov delegation: revert execution of hir_crate_items before delayed lowering This PR reverts rust-lang/rust#154368, as after weekend consideration I don't think that it is a correct way of fixing cycles during delayed lowering: - The number of ICEs were reported, fixing them would require to develop solution from rust-lang/rust#154368 but I am afraid that it would lead to cancer code growing, - The [memory regression](rust-lang/rust#154368 (comment)) for rustdoc was reported, it can be fixed with moving `tcx.force_delayed_owners_lowering` call earlier, but it is already bad that this is call is now required everywhere, before rust-lang/rust#154368 AST was dropped before `hir_crate_items` automatically and users of `rustc` API did not have to think about it. I will try to come up with a more robust solution leaving rust-lang/rust#154368 as a last resort if nothing else will work. Re-opens rust-lang/rust#154169. Fixesrust-lang/rust#155125. Fixesrust-lang/rust#155127. Fixesrust-lang/rust#155128. Fixesrust-lang/rust#155164. Fixesrust-lang/rust#155202. Part of rust-lang/rust#118212. r? @petrochenkov
…, r=petrochenkov delegation: revert execution of hir_crate_items before delayed lowering This PR reverts rust-lang/rust#154368, as after weekend consideration I don't think that it is a correct way of fixing cycles during delayed lowering: - The number of ICEs were reported, fixing them would require to develop solution from rust-lang/rust#154368 but I am afraid that it would lead to cancer code growing, - The [memory regression](rust-lang/rust#154368 (comment)) for rustdoc was reported, it can be fixed with moving `tcx.force_delayed_owners_lowering` call earlier, but it is already bad that this is call is now required everywhere, before rust-lang/rust#154368 AST was dropped before `hir_crate_items` automatically and users of `rustc` API did not have to think about it. I will try to come up with a more robust solution leaving rust-lang/rust#154368 as a last resort if nothing else will work. Re-opens rust-lang/rust#154169. Fixesrust-lang/rust#155125. Fixesrust-lang/rust#155127. Fixesrust-lang/rust#155128. Fixesrust-lang/rust#155164. Fixesrust-lang/rust#155202. Part of rust-lang/rust#118212. r? @petrochenkov
…, r=petrochenkov delegation: revert execution of hir_crate_items before delayed lowering This PR reverts rust-lang/rust#154368, as after weekend consideration I don't think that it is a correct way of fixing cycles during delayed lowering: - The number of ICEs were reported, fixing them would require to develop solution from rust-lang/rust#154368 but I am afraid that it would lead to cancer code growing, - The [memory regression](rust-lang/rust#154368 (comment)) for rustdoc was reported, it can be fixed with moving `tcx.force_delayed_owners_lowering` call earlier, but it is already bad that this is call is now required everywhere, before rust-lang/rust#154368 AST was dropped before `hir_crate_items` automatically and users of `rustc` API did not have to think about it. I will try to come up with a more robust solution leaving rust-lang/rust#154368 as a last resort if nothing else will work. Re-opens rust-lang/rust#154169. Fixesrust-lang/rust#155125. Fixesrust-lang/rust#155127. Fixesrust-lang/rust#155128. Fixesrust-lang/rust#155164. Fixesrust-lang/rust#155202. Part of rust-lang/rust#118212. r? @petrochenkov

View all comments
This PR forces lowering of delayed owners after
hir_crate_items, as some diagnostics usehir_crate_itemswhich results in query cycle which is then hangs callingdef_path_stragain and again. Fixes#154169. Part of #118212.r? @petrochenkov