Closed
Description
I am defining a packed struct the following way:
#[packed]
struct Foo
{
a: u16,
b: u32
}
fn main()
{
println(format!("{:u}", std::sys::size_of::<Foo>()));
}
This code outputs "6" as expected.
Now if I try the following statement:
static f: Foo = Foo { a: 0, b: 0 };
Rustc fails with the following message:
{ i16, i32 } zeroinitializer
<{ i16, i32 }> undef
error: internal compiler error: const expr(17: Foo{a: 0, b: 0,}) of type Foo has size 8 instead of 6