diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 2147331d441d9..5e3cf182f8fcf 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -2408,7 +2408,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 9ebdcf1a9ecb0..9b67595800320 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` + } }