Skip to content

Commit 1a374b8

Browse files
committed
Fix diagnostics for unresolved patterns
1 parent ae33aa7 commit 1a374b8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
24082408
}
24092409
}
24102410
}
2411-
} else {
2411+
} else if let Err(false) = self.resolve_path(pat_id, &path, 0, ValueNS) {
24122412
resolve_error(
24132413
self,
24142414
path.span,

src/test/compile-fail/pattern-error-continue.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@ fn main() {
4242
//~^ ERROR mismatched types
4343
//~| expected `char`
4444
//~| found `bool`
45+
46+
match () {
47+
E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E`
48+
}
4549
}

0 commit comments

Comments
 (0)