rust-lang / trait-system-refactor-initiative

The Rustc Trait System Refactor Initiative
21 stars 0 forks source link

Overflow in mir_borrowck when normalizing region-outlives obligations #99

Open compiler-errors opened 6 months ago

compiler-errors commented 6 months ago
#![feature(type_alias_impl_trait)]

type W = impl Copy;

#[derive(Copy, Clone)]
struct Rec<'a> {
    w: Option<&'a W>,
}

fn recursive_opaque() -> W {
    Rec::</* '?0 */> { w: None }
    // For `Rec<'?0>` to be WF, we must prove `W: '?0`.
    // This requires normalizing `W`, which is normalized to `Rec<'?0>` since it's in our opaque storage.
    // This normalization also registers `WF(Rec<'?0>)`, which then requires `W: '?0`.
    // This continues until we hit the overflow limit, and ICE.
}

fn main() {}