Closed
Description
This is a subissue of #7463.
pub enum H<A, B> {
L(A),
R(B),
}
pub fn test() -> H<i32, i64> {
H::L(0)
}
Compile with rustc -C passes=lint
and you get:
Undefined behavior: Memory reference address is misaligned
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* getelementptr inbounds ({ i8, i32, [8 x i8] }, { i8, i32, [8 x i8] }* @const3020, i32 0, i32 0), i64 16, i32 8, i1 false)
Manually setting alignment of const3020 to 8 in LLVM IR fixes the lint.