about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-04-17 17:50:35 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-04-17 17:50:35 +0530
commite1db767dbca8106de05e28143835f361d39966fd (patch)
treec36eff97ea563df1e5d000068f22b8d01fb43257
parentdf0eb1602072657a4682a7b14c6f1108da16fd4e (diff)
parent1a374b8d11cd59e9a6baae4d4da9350c107bda6a (diff)
downloadrust-e1db767dbca8106de05e28143835f361d39966fd.tar.gz
rust-e1db767dbca8106de05e28143835f361d39966fd.zip
Rollup merge of #33046 - jseyfried:fix_unresolved_pattern_diagnostics, r=eddyb
Fix diagnostics for unresolved patterns

This fixes #33043, a bug in the diagnostics for unresolved patterns.
r? @eddyb
-rw-r--r--src/librustc_resolve/lib.rs2
-rw-r--r--src/test/compile-fail/pattern-error-continue.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index 664cc2f897c..f32cf7aa9f4 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -2406,7 +2406,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                                 }
                             }
                         }
-                    } else {
+                    } else if let Err(false) = self.resolve_path(pat_id, &path, 0, ValueNS) {
                         resolve_error(
                             self,
                             path.span,
diff --git a/src/test/compile-fail/pattern-error-continue.rs b/src/test/compile-fail/pattern-error-continue.rs
index 9ebdcf1a9ec..9b675958003 100644
--- a/src/test/compile-fail/pattern-error-continue.rs
+++ b/src/test/compile-fail/pattern-error-continue.rs
@@ -42,4 +42,8 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected `char`
     //~| found `bool`
+
+    match () {
+        E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E`
+    }
 }