@@ -41,7 +41,8 @@ pub fn walk_expr<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
41
41
expr : & ' thir Expr < ' tcx > ,
42
42
) {
43
43
use ExprKind :: * ;
44
- match expr. kind {
44
+ let Expr { kind, ty : _, temp_lifetime : _, span : _ } = expr;
45
+ match kind {
45
46
Scope { value, region_scope : _, lint_level : _ } => {
46
47
visitor. visit_expr ( & visitor. thir ( ) [ value] )
47
48
}
@@ -191,7 +192,8 @@ pub fn walk_stmt<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
191
192
visitor : & mut V ,
192
193
stmt : & ' thir Stmt < ' tcx > ,
193
194
) {
194
- match & stmt. kind {
195
+ let Stmt { kind } = stmt;
196
+ match kind {
195
197
StmtKind :: Expr { expr, scope : _ } => visitor. visit_expr ( & visitor. thir ( ) [ * expr] ) ,
196
198
StmtKind :: Let {
197
199
initializer,
@@ -217,10 +219,12 @@ pub fn walk_block<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
217
219
visitor : & mut V ,
218
220
block : & ' thir Block ,
219
221
) {
220
- for & stmt in & * block. stmts {
222
+ let Block { stmts, expr, targeted_by_break : _, region_scope : _, span : _, safety_mode : _ } =
223
+ block;
224
+ for & stmt in & * stmts {
221
225
visitor. visit_stmt ( & visitor. thir ( ) [ stmt] ) ;
222
226
}
223
- if let Some ( expr) = block . expr {
227
+ if let Some ( expr) = expr {
224
228
visitor. visit_expr ( & visitor. thir ( ) [ expr] ) ;
225
229
}
226
230
}
@@ -229,11 +233,12 @@ pub fn walk_arm<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
229
233
visitor : & mut V ,
230
234
arm : & ' thir Arm < ' tcx > ,
231
235
) {
232
- if let Some ( expr) = arm. guard {
236
+ let Arm { guard, pattern, body, lint_level : _, span : _, scope : _ } = arm;
237
+ if let Some ( expr) = guard {
233
238
visitor. visit_expr ( & visitor. thir ( ) [ expr] )
234
239
}
235
- visitor. visit_pat ( & arm . pattern ) ;
236
- visitor. visit_expr ( & visitor. thir ( ) [ arm . body ] ) ;
240
+ visitor. visit_pat ( pattern) ;
241
+ visitor. visit_expr ( & visitor. thir ( ) [ body] ) ;
237
242
}
238
243
239
244
pub fn walk_pat < ' thir , ' tcx : ' thir , V : Visitor < ' thir , ' tcx > > (
@@ -249,7 +254,8 @@ pub(crate) fn for_each_immediate_subpat<'a, 'tcx>(
249
254
pat : & ' a Pat < ' tcx > ,
250
255
mut callback : impl FnMut ( & ' a Pat < ' tcx > ) ,
251
256
) {
252
- match & pat. kind {
257
+ let Pat { kind, ty : _, span : _ } = pat;
258
+ match kind {
253
259
PatKind :: Missing
254
260
| PatKind :: Wild
255
261
| PatKind :: Binding { subpattern : None , .. }
0 commit comments