fix: check before index into generated patterns
This commit is contained in:
parent
2fd2796aae
commit
77fb6a0f32
8 changed files with 26 additions and 81 deletions
|
@ -1343,7 +1343,9 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
|
|||
match &mut fields {
|
||||
Fields::Vec(pats) => {
|
||||
for (i, pat) in new_pats {
|
||||
pats[i] = pat
|
||||
if let Some(p) = pats.get_mut(i) {
|
||||
*p = pat;
|
||||
}
|
||||
}
|
||||
}
|
||||
Fields::Filtered { fields, .. } => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue