Add regression test
This commit is contained in:
parent
f6da141b5f
commit
2c57d1d256
@ -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
|
||||
}
|
||||
}
|
||||
|
9
src/test/ui/consts/match_ice.stderr
Normal file
9
src/test/ui/consts/match_ice.stderr
Normal 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`.
|
Loading…
x
Reference in New Issue
Block a user