This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 58042bf
authored
Rollup merge of rust-lang#99340 - GoldsteinE:fix-localdefid-debug-ice, r=lcnr
Fix ICE in Definitions::create_def
`Debug` implementation for `LocalDefId` uses global `Definitions`. Normally it’s ok, but we can’t do it while holding a mutable reference to `Definitions`, since it causes ICE or deadlock (depending on whether `parallel_compiler` is enabled).
This PR effectively copies the `Debug` implementation into the problematic method. I don’t particularly love this solution (since it creates code duplication), but I don’t see any other options.
This issue was discovered when running `rustdoc` with `RUSTDOC_LOG=trace` on the following file:
```rust
pub struct SomeStruct;
fn asdf() {
impl SomeStruct {
pub fn qwop(&self) {
println!("hidden function");
}
}
}
```
I’m not sure how to create a test for this behavior.File tree
2 files changed
+8
-3
lines changed- compiler
- rustc_hir/src
- rustc_middle/src/ty
2 files changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
342 | 347 | | |
343 | 348 | | |
344 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1459 | 1459 | | |
1460 | 1460 | | |
1461 | 1461 | | |
1462 | | - | |
| 1462 | + | |
1463 | 1463 | | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | | - | |
| 1466 | + | |
1467 | 1467 | | |
1468 | 1468 | | |
1469 | 1469 | | |
| |||
0 commit comments