Add regression test

This commit is contained in:
Oliver Scherer 2019-01-14 19:51:00 +01:00
parent f6da141b5f
commit 2c57d1d256
2 changed files with 11 additions and 3 deletions

View File

@ -1,11 +1,10 @@
// compile-pass
// https://github.com/rust-lang/rust/issues/53708
struct S;
fn main() {
const C: &S = &S;
match C {
C => {}
match C { //~ ERROR non-exhaustive
C => {} // this is a common bug around constants and references in patterns
}
}

View File

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