Skip to content

Commit 9c9a947

Browse files
committed
test more enum-int-cast code paths
1 parent a379537 commit 9c9a947

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/run-pass/c_enums.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ enum Signed {
1111
}
1212

1313
fn foo() -> [u8; 3] {
14-
[Foo::Bar as u8, Foo::Baz as u8, Foo::Quux as u8]
14+
let baz = Foo::Baz; // let-expansion changes the MIR significantly
15+
[Foo::Bar as u8, baz as u8, Foo::Quux as u8]
1516
}
1617

1718
fn signed() -> [i8; 3] {
18-
[Signed::Bar as i8, Signed::Baz as i8, Signed::Quux as i8]
19+
let baz = Signed::Baz; // let-expansion changes the MIR significantly
20+
[Signed::Bar as i8, baz as i8, Signed::Quux as i8]
1921
}
2022

2123
fn unsafe_match() -> bool {

0 commit comments

Comments
 (0)