Closed
Description
The following code (playground) ICEs with error: internal compiler error: /checkout/src/librustc/ty/layout.rs:603: Struct cannot be packed and aligned
:
#![feature(repr_align, attr_literals)]
#[repr(packed)]
#[repr(align(4))]
pub struct BadStruct {
foo: i32
}
fn main() {
BadStruct { foo: 0 };
}
It's probably correct that this is an error, but it should not be an ICE. Also, the ICE only appears when the struct is actually instantiated, only defining it is not sufficient, but should also result in an error.