-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 when calling std::mem::align_of() on recursive struct with fixed-size vec #19001
Comments
I just received this same error when using the following: use std::rc::Rc;
struct Test {
children: [Option<Rc<Test>>; 8],
}
impl Test {
fn get_child() -> Option<Rc<Test>> {
None
}
} I tried to reduce the code as much as possible and still get the error. |
No longer ICEs. Both examples compile without error: use std::mem;
struct AlignmentStruct {
ptr: *mut [AlignmentStruct; 1]
}
fn main() {
println!("{}", ::std::mem::align_of::<AlignmentStruct>());
} use std::rc::Rc;
struct Test {
children: [Option<Rc<Test>>; 8],
}
impl Test {
fn get_child() -> Option<Rc<Test>> {
None
}
}
fn main() {
// Add code here
} |
I get a strange error for the first:
and the second both. |
$ rustc --version
rustc 1.0.0-dev (f46c4e158 2015-04-20) (built 2015-04-20) @steveklabnik what do you have? |
|
@steveklabnik could yours have been built against a different LLVM version? cc @alexcrichton because I don't know how the buildbots do their thing |
I'm just doing whatever |
@tamird this probably has to do with LLVM assertions being disabled by default in nightly |
still an issue on 1.4. |
This appears to compile successfully now. |
Still hits an LLVM assertion with the latest nightly for me. @apasel422 stable and beta builds have LLVM assertions disabled, so you can't reproduce with those. |
Hmm, I just built from source with LLVM assertions enabled and it appeared On Monday, October 26, 2015, Björn Steinbrink [email protected]
|
I'll try with a local build once it finished. And I forgot to mention that only the second example given by @tamird still fails for me. The first one works fine. |
Yes, that example by @tamird continues to fail. |
when evaluating a recursive type, the type_of of the interior could be still in progress, so we can't use that. Fixes rust-lang#19001
Example program:
Error message:
The text was updated successfully, but these errors were encountered: