-
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
Corrupted initialization in the static struct #5688
Comments
@graydon: this looks similar to the static array problem you were dealing with before |
Does, yes. But I pushed a fix last week. Can you reproduce on incoming? |
@graydon I've tested the code with the recent master ( |
Reproduced with 84233c0 on |
This code now works: struct X { vec: &'static [int] }
static V: &'static [X] = &[X { vec: &[1, 2, 3] }];
fn main() {
for &v in V.iter() {
println(fmt!("%?", v.vec));
}
} Flagging as needstest. |
…p1995 Fix cargo tests when running inside the rustlang/rust repo It seems we hit rust-lang/cargo#5418, so I've applied the suggested solution. Also added some more info when cargo-metadata fails to execute. (there was no open issue for this) changelog: none
...should print
&[1, 2, 3]
but instead prints something like&[4492532864, 24]
. It is pretty evident that the compiler messed up with the representation of[int, ..n]
and[int]
somehow, or at least failed to typecheck correctly.The text was updated successfully, but these errors were encountered: