diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-04-14 18:15:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-14 18:15:32 +0200 |
| commit | 87c319a7701640185ebb8b3e043173ffaab542de (patch) | |
| tree | 25d191e1caf04cdaf84336195ceb4ec659b9b243 /compiler/rustc_interface/src/errors.rs | |
| parent | 143f5d76966b6f166187d82ca44ead7e36108fde (diff) | |
| parent | 83ea3454dfaf7ff54171035a70a89d03085d2a9d (diff) | |
| download | rust-87c319a7701640185ebb8b3e043173ffaab542de.tar.gz rust-87c319a7701640185ebb8b3e043173ffaab542de.zip | |
Rollup merge of #139777 - compiler-errors:debuggier-proj, r=lcnr
Remove `define_debug_via_print` for `ExistentialProjection`, use regular structural debug impl
The pretty print impl for `ExistentialProjection` always prints `AssocItem = Ty`:
https://github.com/rust-lang/rust/blob/6e830462330a9e34d8176e86d4580dd0820c6fd5/compiler/rustc_middle/src/ty/print/pretty.rs#L3293-L3299
We can't change this, b/c it's used for both pretty printing dyn types and for legacy symbol mangling.
Unfortunately, we also use this printing procedure for `Debug` impls. That means that it leaves out the *trait name* and *trait args* when debug printing an `ExistentialProjection` (or an `ExistentialPredicate` which has a variant for `ExistentialProjection`). This leads to awkward situations, like the two seemingly identical existential projection predicates present in a `dyn Trait` type using the definition below:
```rust
trait Super { type Assoc; }
trait Foo: Super<A, Assoc = i32> + Super<B, Assoc = i32> {}
```
Namely, they both just render as `Projection(Assoc = i32)`! This makes debugging `dyn Trait` type system bugs really hard, so let's use the *regular* debug impl for `ExistentialProjection`.
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
