fix "still mutable" ice while metrics are enabled#139502
fix "still mutable" ice while metrics are enabled#139502bors merged 1 commit intorust-lang:masterfrom
Conversation
we have a run-make test but I doubt it enables incremental compilation. I can enable that, question is do I just do that on the same test, do I create a second otherwise identical test that uses incremental, or is there some way to make the test run twice, once with and once without incremental compilation enabled? |
|
A second test is best, minimized to whatever you need to repro the breakage. Also probably best to check that it faithfully reproduces the ICE without the change in this PR. |
|
maybe we could also change "still mutable" to be slightly more descriptive? 😅 |
probably something like "freezelock should not be frozen since we're still trying to write to it" |
|
This PR modifies cc @jieyouxu |
This comment was marked as outdated.
This comment was marked as outdated.
|
I got it btw, I needed a late bound parameter which seemed to be the common factor in both of the repros I encountered |
|
@bors r+ |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#139502 (fix "still mutable" ice while metrics are enabled) - rust-lang#139510 (Rename some `name` variables as `ident`.) - rust-lang#139606 (Update compiletest to Edition 2024) - rust-lang#139609 (compiletest: don't use stringly paths for `compose_and_run`) - rust-lang#139614 (Avoid empty identifiers for delegate params and args.) - rust-lang#139626 (Remove unnecessary `mut` in test.) - rust-lang#139630 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139502 - yaahc:still-mutable-ice, r=bjorn3 fix "still mutable" ice while metrics are enabled Resolves "still mutable" ICE discovered by `@matthiaskrgr` here: [#t-docs-rs > metrics intitiative @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/356853-t-docs-rs/topic/metrics.20intitiative/near/510490790) This was caused by invoking `crate_hash` before the `definitions` struct was frozen here: https://github.com/rust-lang/rust/blob/e643f59f6da3a84f43e75dea99afaa5b041ea6bf/compiler/rustc_interface/src/passes.rs#L951 resolved by moving metrics dumping to occur after `analysis` freezes the definitions I'm guessing we didn't discover this in CI because the problem only occurs when you try to calculate the crash hash with incremental compilation enabled when it tries to freeze the definitions here: https://github.com/rust-lang/rust/blob/e643f59f6da3a84f43e75dea99afaa5b041ea6bf/compiler/rustc_middle/src/hir/map.rs#L1172 my understanding is that this causes us to freeze the definitions too early in compilation, then we subsequently try to mutate them, likely during `analysis`, and this causes the ICE. r? `@bjorn3`
Resolves "still mutable" ICE discovered by @matthiaskrgr here: #t-docs-rs > metrics intitiative @ 💬
This was caused by invoking
crate_hashbefore thedefinitionsstruct was frozen here:rust/compiler/rustc_interface/src/passes.rs
Line 951 in e643f59
resolved by moving metrics dumping to occur after
analysisfreezes the definitionsI'm guessing we didn't discover this in CI because the problem only occurs when you try to calculate the crash hash with incremental compilation enabled when it tries to freeze the definitions here:
rust/compiler/rustc_middle/src/hir/map.rs
Line 1172 in e643f59
my understanding is that this causes us to freeze the definitions too early in compilation, then we subsequently try to mutate them, likely during
analysis, and this causes the ICE.r? @bjorn3