@@ -366,12 +366,12 @@ impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> {
366
366
lsets. warn_about_unused_args ( body, entry_ln) ;
367
367
}
368
368
369
- fn visit_local ( & mut self , local : & ' tcx hir:: Local < ' tcx > , els : Option < & ' tcx hir :: Block < ' tcx > > ) {
369
+ fn visit_local ( & mut self , local : & ' tcx hir:: Local < ' tcx > ) {
370
370
self . add_from_pat ( & local. pat ) ;
371
- if els. is_some ( ) {
371
+ if local . els . is_some ( ) {
372
372
self . add_live_node_for_node ( local. hir_id , ExprNode ( local. span , local. hir_id ) ) ;
373
373
}
374
- intravisit:: walk_local ( self , local, els ) ;
374
+ intravisit:: walk_local ( self , local) ;
375
375
}
376
376
377
377
fn visit_arm ( & mut self , arm : & ' tcx hir:: Arm < ' tcx > ) {
@@ -788,7 +788,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
788
788
789
789
fn propagate_through_stmt ( & mut self , stmt : & hir:: Stmt < ' _ > , succ : LiveNode ) -> LiveNode {
790
790
match stmt. kind {
791
- hir:: StmtKind :: Local ( ref local, els ) => {
791
+ hir:: StmtKind :: Local ( ref local) => {
792
792
// Note: we mark the variable as defined regardless of whether
793
793
// there is an initializer. Initially I had thought to only mark
794
794
// the live variable as defined if it was initialized, and then we
@@ -803,7 +803,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
803
803
// initialization, which is mildly more complex than checking
804
804
// once at the func header but otherwise equivalent.
805
805
806
- if let Some ( els) = els {
806
+ if let Some ( els) = local . els {
807
807
// Eventually, `let pat: ty = init else { els };` is mostly equivalent to
808
808
// `let (bindings, ...) = match init { pat => (bindings, ...), _ => els };`
809
809
// except that extended lifetime applies at the `init` location.
@@ -1341,14 +1341,14 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1341
1341
// Checking for error conditions
1342
1342
1343
1343
impl < ' a , ' tcx > Visitor < ' tcx > for Liveness < ' a , ' tcx > {
1344
- fn visit_local ( & mut self , local : & ' tcx hir:: Local < ' tcx > , els : Option < & ' tcx hir :: Block < ' tcx > > ) {
1344
+ fn visit_local ( & mut self , local : & ' tcx hir:: Local < ' tcx > ) {
1345
1345
self . check_unused_vars_in_pat ( & local. pat , None , |spans, hir_id, ln, var| {
1346
1346
if local. init . is_some ( ) {
1347
1347
self . warn_about_dead_assign ( spans, hir_id, ln, var) ;
1348
1348
}
1349
1349
} ) ;
1350
1350
1351
- intravisit:: walk_local ( self , local, els ) ;
1351
+ intravisit:: walk_local ( self , local) ;
1352
1352
}
1353
1353
1354
1354
fn visit_expr ( & mut self , ex : & ' tcx Expr < ' tcx > ) {
0 commit comments