mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 22:48:48 +00:00
Don't trigger if a binding is in the else pattern
This commit is contained in:
parent
2967127de2
commit
b46f1c4a7f
1 changed files with 4 additions and 1 deletions
|
@ -242,7 +242,10 @@ fn form_exhaustive_matches<'a>(cx: &LateContext<'a>, ty: Ty<'a>, left: &Pat<'_>,
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
(PatKind::TupleStruct(..), PatKind::Path(_) | PatKind::TupleStruct(..)) => in_candidate_enum(cx, ty),
|
(PatKind::TupleStruct(..), PatKind::Path(_)) => in_candidate_enum(cx, ty),
|
||||||
|
(PatKind::TupleStruct(..), PatKind::TupleStruct(_, inner, _)) => {
|
||||||
|
in_candidate_enum(cx, ty) && inner.iter().all(contains_only_wilds)
|
||||||
|
},
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue