auto trait leakage can be used to leak arbitrary types #134578
Labels
A-auto-traits
Area: auto traits (e.g., `auto trait Send {}`)
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
I-types-nominated
Nominated for discussion during a types team meeting.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
When leaking the hidden type of opaques when proving auto traits, we can leak their hidden type to the caller by relying on type inference. See lcnr/random-rust-snippets#13 for minimized examples.
Note that this allows us to access foreign closures during typeck/borrowck. This very easily results in ICE, as this code expects all encountered closures to be local:
results in
rust/compiler/rustc_hir_typeck/src/coercion.rs
Line 1202 in fcc1615
There are a lot of such uses, this was simply the first one i've triggered.
The text was updated successfully, but these errors were encountered: