diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-03-09 10:34:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-09 10:34:53 +0100 |
| commit | 92fd45b14f5cdeaf25f2f7dd6aff49f7686880e1 (patch) | |
| tree | ffa24cf92d9772b81d3eabe55fe29f3e63392847 /compiler/rustc_codegen_llvm/src/consts.rs | |
| parent | 7d928a9a2e303344588f914329adfb34a3a8a04e (diff) | |
| parent | f83af2aa6b395c2e6c5639e8536f08f24d3f2128 (diff) | |
| download | rust-92fd45b14f5cdeaf25f2f7dd6aff49f7686880e1.tar.gz rust-92fd45b14f5cdeaf25f2f7dd6aff49f7686880e1.zip | |
Rollup merge of #138216 - Zalathar:any-debug, r=onur-ozkan
bootstrap: Fix stack printing when a step cycle is detected
When bootstrap detects a step dependency cycle (which represents a bootstrap bug), it is supposed to print out the contents of the step stack as part of its panic message.
However, while investigating #138205 it was found that bootstrap was actually printing out several copies of `Any { .. }`, because that is the Debug implementation for `dyn Any`. This is sadly not very helpful.
This PR fixes that problem by introducing a `trait AnyDebug: Any + Debug` that delegates to the underlying type's Debug implementation, while still allowing downcasting via Any.
---
The fixed behaviour can be verified manually (and is tested automatically) via a new dummy command, `./x run cyclic-step`:
```
$ x run cyclic-step
Building bootstrap
Finished `dev` profile [unoptimized] target(s) in 0.02s
thread 'main' panicked at src/bootstrap/src/core/builder/mod.rs:1521:17:
Cycle in build detected when adding CyclicStep { n: 0 }
CyclicStep { n: 0 }
CyclicStep { n: 1 }
CyclicStep { n: 2 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:00
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/consts.rs')
0 files changed, 0 insertions, 0 deletions
