11use rustc_middle:: mir:: visit:: { PlaceContext , Visitor } ;
2- use rustc_middle:: mir:: { Local , Location , Place , Statement , StatementKind , TerminatorKind } ;
2+ use rustc_middle:: mir:: {
3+ Local , Location , Place , Statement , StatementKind , Terminator , TerminatorKind ,
4+ } ;
35
46use rustc_data_structures:: fx:: FxHashSet ;
57
@@ -62,9 +64,9 @@ impl GatherUsedMutsVisitor<'_, '_, '_> {
6264}
6365
6466impl < ' visit , ' cx , ' tcx > Visitor < ' tcx > for GatherUsedMutsVisitor < ' visit , ' cx , ' tcx > {
65- fn visit_terminator_kind ( & mut self , kind : & TerminatorKind < ' tcx > , _location : Location ) {
66- debug ! ( "visit_terminator_kind: kind ={:?}" , kind ) ;
67- match & kind {
67+ fn visit_terminator ( & mut self , terminator : & Terminator < ' tcx > , _location : Location ) {
68+ debug ! ( "visit_terminator: terminator ={:?}" , terminator ) ;
69+ match & terminator . kind {
6870 TerminatorKind :: Call { destination : Some ( ( into, _) ) , .. } => {
6971 self . remove_never_initialized_mut_locals ( * into) ;
7072 }
@@ -73,6 +75,8 @@ impl<'visit, 'cx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'tc
7375 }
7476 _ => { }
7577 }
78+
79+ // FIXME: no super_terminator?
7680 }
7781
7882 fn visit_statement ( & mut self , statement : & Statement < ' tcx > , _location : Location ) {
@@ -84,6 +88,8 @@ impl<'visit, 'cx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'tc
8488 ) ;
8589 self . remove_never_initialized_mut_locals ( * into) ;
8690 }
91+
92+ // FIXME: no super_statement?
8793 }
8894
8995 fn visit_local ( & mut self , local : & Local , place_context : PlaceContext , location : Location ) {
@@ -101,5 +107,7 @@ impl<'visit, 'cx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'tc
101107 }
102108 }
103109 }
110+
111+ // FIXME: no super_local?
104112 }
105113}
0 commit comments