Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM assertion failure with self-referential struct #3778

Closed
catamorphism opened this issue Oct 16, 2012 · 4 comments
Closed

LLVM assertion failure with self-referential struct #3778

catamorphism opened this issue Oct 16, 2012 · 4 comments
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@catamorphism
Copy link
Contributor

@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.

@nikomatsakis
Copy link
Contributor

For easier reference, here is a test which fails that should work, afaict:

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

fn main() {
    let t = Tree {leftTree: @None, rightTree: @None, key: 0};
}

@nikomatsakis
Copy link
Contributor

Not critical for 0.6; removing milestone

@catamorphism
Copy link
Contributor Author

This might be a dup, but if not, nominating for milestone 5 (production-ready)

@jbclements
Copy link
Contributor

appears to work now.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 5, 2024
FD: refactor API names a little

I feel like these two functions are different enough that their names should not indicate complete symmetry. I am not sure what the best names would be, though... `@oli-obk` any opinions?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants