Skip to content

Overflow in mir_borrowck when normalizing region-outlives obligations #99

Open
@compiler-errors

Description

@compiler-errors
#![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() {}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    potentially irrelevant

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions