Skip to content

Compiler hangs when compiling mutually-defined enums #55625

Closed
@varkor

Description

@varkor
#[derive(Clone)]
enum A<T> {
    A1(B<T>),
    A2(B<Option<T>>),
}

#[derive(Clone)]
enum B<T> {
    B1(T),
    B2(Box<A<B<T>>>),
}

fn main() {}

The following fails to halt or emit any warnings or errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions