From 2c57d1d256b84d3bd7f4a1d9613091bd9ec3ca02 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Mon, 14 Jan 2019 19:51:00 +0100 Subject: [PATCH] Add regression test --- src/test/ui/consts/match_ice.rs | 5 ++--- src/test/ui/consts/match_ice.stderr | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/test/ui/consts/match_ice.stderr diff --git a/src/test/ui/consts/match_ice.rs b/src/test/ui/consts/match_ice.rs index c785317778b3..53c5782a4c70 100644 --- a/src/test/ui/consts/match_ice.rs +++ b/src/test/ui/consts/match_ice.rs @@ -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 } } diff --git a/src/test/ui/consts/match_ice.stderr b/src/test/ui/consts/match_ice.stderr new file mode 100644 index 000000000000..e6e04e2c4627 --- /dev/null +++ b/src/test/ui/consts/match_ice.stderr @@ -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`.