Skip to content

Commit 7dfb9ed

Browse files
add regression test
1 parent 76a7772 commit 7dfb9ed

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/ui/pattern/issue-110508.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// run-pass
2+
3+
#[derive(PartialEq, Eq)]
4+
pub enum Foo {
5+
FooA(()),
6+
FooB(Vec<()>),
7+
}
8+
9+
impl Foo {
10+
const A1: Foo = Foo::FooA(());
11+
const A2: Foo = Self::FooA(());
12+
const A3: Self = Foo::FooA(());
13+
const A4: Self = Self::FooA(());
14+
}
15+
16+
fn main() {
17+
let foo = Foo::FooA(());
18+
19+
match foo {
20+
Foo::A1 => {},
21+
_ => {},
22+
}
23+
24+
match foo {
25+
Foo::A2 => {},
26+
_ => {},
27+
}
28+
29+
match foo {
30+
Foo::A3 => {},
31+
_ => {},
32+
}
33+
34+
match foo {
35+
Foo::A4 => {},
36+
_ => {},
37+
}
38+
}

0 commit comments

Comments
 (0)