mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Skip match exhaustiveness checking if pattern type contains errors
This commit is contained in:
parent
4981f00bb6
commit
26c7bfd0b4
1 changed files with 3 additions and 0 deletions
|
@ -196,6 +196,9 @@ impl ExprValidator {
|
||||||
let Some(pat_ty) = self.infer.type_of_pat.get(arm.pat) else {
|
let Some(pat_ty) = self.infer.type_of_pat.get(arm.pat) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
if pat_ty.contains_unknown() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We only include patterns whose type matches the type
|
// We only include patterns whose type matches the type
|
||||||
// of the scrutinee expression. If we had an InvalidMatchArmPattern
|
// of the scrutinee expression. If we had an InvalidMatchArmPattern
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue