Skip to content

LLVM assertion failure with self-referential struct #3778

Closed
@catamorphism

Description

@catamorphism

@am0d reported that this code: https://gist.github.com/3885764 causes this assertion failure:

Assertion failed: (Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!")```

The assertion failure is the same as in #2718, but it must be at least a slightly different bug, as the test for #2718 passes.

If I change the struct definition in the code to:

struct Tree {
    mut leftTree: Option<@Tree>,
    mut rightTree: Option<@Tree>,
    key: int
}

it compiles successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions