about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2019-01-14 19:51:00 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2019-01-22 17:22:30 +0100
commit2c57d1d256b84d3bd7f4a1d9613091bd9ec3ca02 (patch)
treebba900f356d0c5037b7912b818bb00794227f0f4
parentf6da141b5f1d30f11be503db9783fa61a276c87b (diff)
downloadrust-2c57d1d256b84d3bd7f4a1d9613091bd9ec3ca02.tar.gz
rust-2c57d1d256b84d3bd7f4a1d9613091bd9ec3ca02.zip
Add regression test
-rw-r--r--src/test/ui/consts/match_ice.rs5
-rw-r--r--src/test/ui/consts/match_ice.stderr9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/test/ui/consts/match_ice.rs b/src/test/ui/consts/match_ice.rs
index c785317778b..53c5782a4c7 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 00000000000..e6e04e2c462
--- /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`.