Auto merge of #2337 - RalfJung:rustup, r=RalfJung
rustup Adds a regression test for https://github.com/rust-lang/rust/issues/96185
This commit is contained in:
commit
6fcf4826de
2 changed files with 14 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
41ad4d9b2dbb895666337d162eda52619a6056db
|
||||
f342bea9d19f14616c6559312552e6d0ee529cfd
|
||||
|
|
|
|||
|
|
@ -119,6 +119,18 @@ fn more_discriminant_overflow() {
|
|||
}
|
||||
}
|
||||
|
||||
fn overaligned_casts() {
|
||||
#[allow(dead_code)]
|
||||
#[repr(align(8))]
|
||||
enum Aligned {
|
||||
Zero = 0,
|
||||
One = 1,
|
||||
}
|
||||
|
||||
let aligned = Aligned::Zero;
|
||||
assert_eq!(aligned as u8, 0);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test(MyEnum::MyEmptyVariant);
|
||||
test(MyEnum::MyNewtypeVariant(42));
|
||||
|
|
@ -127,4 +139,5 @@ fn main() {
|
|||
|
||||
discriminant_overflow();
|
||||
more_discriminant_overflow();
|
||||
overaligned_casts();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue