Skip to content

Commit

Permalink
Don't glob-import overlapping variant names in test/codegen/match-opt…
Browse files Browse the repository at this point in the history
…imizes-away.rs.
  • Loading branch information
eddyb committed Nov 19, 2017
1 parent 95687bf commit fb83283
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/test/codegen/match-optimizes-away.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@
// compile-flags: -O
#![crate_type="lib"]

pub enum Three { First, Second, Third }
use Three::*;
pub enum Three { A, B, C }

pub enum Four { First, Second, Third, Fourth }
use Four::*;
pub enum Four { A, B, C, D }

#[no_mangle]
pub fn three_valued(x: Three) -> Three {
// CHECK-LABEL: @three_valued
// CHECK-NEXT: {{^.*:$}}
// CHECK-NEXT: ret i8 %0
match x {
First => First,
Second => Second,
Third => Third,
Three::A => Three::A,
Three::B => Three::B,
Three::C => Three::C,
}
}

Expand All @@ -36,9 +34,9 @@ pub fn four_valued(x: Four) -> Four {
// CHECK-NEXT: {{^.*:$}}
// CHECK-NEXT: ret i8 %0
match x {
First => First,
Second => Second,
Third => Third,
Fourth => Fourth,
Four::A => Four::A,
Four::B => Four::B,
Four::C => Four::C,
Four::D => Four::D,
}
}

0 comments on commit fb83283

Please sign in to comment.