Skip to content

Commit b805232

Browse files
committed
Add regression test
1 parent 87bef92 commit b805232

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/test/ui/consts/match_ice.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
// compile-pass
21
// https://github.com/rust-lang/rust/issues/53708
32

43
struct S;
54

65
fn main() {
76
const C: &S = &S;
8-
match C {
9-
C => {}
7+
match C { //~ ERROR non-exhaustive
8+
C => {} // this is a common bug around constants and references in patterns
109
}
1110
}

src/test/ui/consts/match_ice.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0004]: non-exhaustive patterns: `&S` not covered
2+
--> $DIR/match_ice.rs:7:11
3+
|
4+
LL | match C { //~ ERROR non-exhaustive
5+
| ^ pattern `&S` not covered
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0004`.

0 commit comments

Comments
 (0)