Skip to content

Rustc compiler freezes when creating a recursive data structure #33310

Closed
@antoyo

Description

@antoyo

Hello.
The following code makes the compiler freezes:

struct Node {
    value: i32,
    left: Option<Node>,
    right: Option<Node>,
}

fn main() {
    println!("Hello, world!");
}

(the version with Option<Box<Node>> works fine, though)

Running cargo build takes forever. I use rustc 1.8.0 on ArchLinux.

Thanks to fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions