Skip to content

Commit

Permalink
Explicitly write out all fields
Browse files Browse the repository at this point in the history
  • Loading branch information
syvb committed Jun 17, 2021
1 parent 1d5acca commit 281dd6d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions compiler/rustc_mir_build/src/thir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,19 @@ pub fn walk_arm<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, arm: &Arm<'
pub fn walk_pat<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, pat: &Pat<'tcx>) {
use PatKind::*;
match pat.kind.as_ref() {
AscribeUserType { subpattern, .. }
| Deref { subpattern, .. }
| Binding { subpattern: Some(subpattern), .. } => visitor.visit_pat(&subpattern),
AscribeUserType { subpattern, ascription: _ }
| Deref { subpattern }
| Binding {
subpattern: Some(subpattern),
mutability: _,
mode: _,
var: _,
ty: _,
is_primary: _,
name: _,
} => visitor.visit_pat(&subpattern),
Binding { .. } | Wild => {}
Variant { subpatterns, .. } | Leaf { subpatterns } => {
Variant { subpatterns, adt_def: _, substs: _, variant_index: _ } | Leaf { subpatterns } => {
for subpattern in subpatterns {
visitor.visit_pat(&subpattern.pattern);
}
Expand Down

0 comments on commit 281dd6d

Please sign in to comment.