Skip to content

unavoidable overflow due to cycle fixpoint + region constaints #118

Open
@lcnr

Description

@lcnr
struct MyType<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
    is_static: SendIfStatic<'a>,
    rot: Option<Box<MyType<'b, 'c, 'd, 'e, 'f, 'g, 'h, 'a>>>,
}

struct SendIfStatic<'a>(&'a ());
unsafe impl Send for SendIfStatic<'static> {}

fn is_send<T: Send>(x: T) {}

fn main() {
    let is_static = SendIfStatic(&());
    is_send(MyType {
        is_static,
        rot: None, 
    })
}

this compiles with the old solver and overflows with new. https://rust.godbolt.org/z/v9bMKM5T4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    potentially irrelevant

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions