Skip to content

Commit e1db767

Browse files
committed
Rollup merge of rust-lang#33046 - jseyfried:fix_unresolved_pattern_diagnostics, r=eddyb
Fix diagnostics for unresolved patterns This fixes rust-lang#33043, a bug in the diagnostics for unresolved patterns. r? @eddyb
2 parents df0eb16 + 1a374b8 commit e1db767

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: src/librustc_resolve/lib.rs

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

Diff for: 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)