Skip to content

rustup #2337

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

Merged
merged 1 commit into from
Jul 6, 2022
Merged

rustup #2337

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
41ad4d9b2dbb895666337d162eda52619a6056db
f342bea9d19f14616c6559312552e6d0ee529cfd
13 changes: 13 additions & 0 deletions tests/pass/enums.rs
Original file line number Diff line number Diff line change
@@ -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();
}