Skip to content

Commit c3358a4

Browse files
committed
Don't glob-import overlapping variant names in test/codegen/match-optimizes-away.rs.
1 parent aabfed5 commit c3358a4

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/test/codegen/match-optimizes-away.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@
1212
// compile-flags: -O
1313
#![crate_type="lib"]
1414

15-
pub enum Three { First, Second, Third }
16-
use Three::*;
15+
pub enum Three { A, B, C }
1716

18-
pub enum Four { First, Second, Third, Fourth }
19-
use Four::*;
17+
pub enum Four { A, B, C, D }
2018

2119
#[no_mangle]
2220
pub fn three_valued(x: Three) -> Three {
2321
// CHECK-LABEL: @three_valued
2422
// CHECK-NEXT: {{^.*:$}}
2523
// CHECK-NEXT: ret i8 %0
2624
match x {
27-
First => First,
28-
Second => Second,
29-
Third => Third,
25+
Three::A => Three::A,
26+
Three::B => Three::B,
27+
Three::C => Three::C,
3028
}
3129
}
3230

@@ -36,9 +34,9 @@ pub fn four_valued(x: Four) -> Four {
3634
// CHECK-NEXT: {{^.*:$}}
3735
// CHECK-NEXT: ret i8 %0
3836
match x {
39-
First => First,
40-
Second => Second,
41-
Third => Third,
42-
Fourth => Fourth,
37+
Four::A => Four::A,
38+
Four::B => Four::B,
39+
Four::C => Four::C,
40+
Four::D => Four::D,
4341
}
4442
}

0 commit comments

Comments
 (0)