Skip to content

ICE const value has different size than its type (again) #11882

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

Closed
lifthrasiir opened this issue Jan 28, 2014 · 2 comments
Closed

ICE const value has different size than its type (again) #11882

lifthrasiir opened this issue Jan 28, 2014 · 2 comments

Comments

@lifthrasiir
Copy link
Contributor

This is another manifestation of #6352.

pub enum X { P, Q(u64) }
pub struct Y { b: X, c: u32 }
pub static Z: Y = Y { b: P, c: 24 };
fn main() {}

...results in the ICE:

{ { i8, [15 x i8] }, i32 } { { i8, [15 x i8] } { i8 0, [15 x i8] undef }, i32 24 }
{ { i8, [7 x i8], [1 x i64] }, i32 } undef
error: internal compiler error: const expr(25: Y{b: P, c: 24,}) of type Y has size 20 instead of 24
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html

Tested with the recent nightly both in Ubuntu (x86_64-unknown-linux-gnu, 201401280405, 8c6c229) and Windows (i686-pc-mingw32, 0.10.20140123, couldn't locate the exact commit).

@jdm
Copy link
Contributor

jdm commented Jan 28, 2014

I suspect this is in @jld's domain.

lifthrasiir added a commit to snrs/sonorous that referenced this issue Jan 30, 2014
@erickt
Copy link
Contributor

erickt commented May 11, 2014

This compiles for me now. Closing.

@erickt erickt closed this as completed May 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants