Store field indices in DeconstructedPat
to avoid virtual wildcards
This commit is contained in:
parent
c1e68860d0
commit
6ae9fa31f0
4 changed files with 102 additions and 84 deletions
|
@ -917,7 +917,9 @@ fn report_arm_reachability<'p, 'tcx>(
|
|||
fn pat_is_catchall(pat: &DeconstructedPat<'_, '_>) -> bool {
|
||||
match pat.ctor() {
|
||||
Constructor::Wildcard => true,
|
||||
Constructor::Struct | Constructor::Ref => pat.iter_fields().all(|pat| pat_is_catchall(pat)),
|
||||
Constructor::Struct | Constructor::Ref => {
|
||||
pat.iter_fields().all(|ipat| pat_is_catchall(&ipat.pat))
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue