1
1
use 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
+ } ;
3
5
4
6
use rustc_data_structures:: fx:: FxHashSet ;
5
7
@@ -62,9 +64,9 @@ impl GatherUsedMutsVisitor<'_, '_, '_> {
62
64
}
63
65
64
66
impl < ' 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 {
68
70
TerminatorKind :: Call { destination : Some ( ( into, _) ) , .. } => {
69
71
self . remove_never_initialized_mut_locals ( * into) ;
70
72
}
@@ -73,6 +75,8 @@ impl<'visit, 'cx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'tc
73
75
}
74
76
_ => { }
75
77
}
78
+
79
+ // FIXME: no super_terminator?
76
80
}
77
81
78
82
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
84
88
) ;
85
89
self . remove_never_initialized_mut_locals ( * into) ;
86
90
}
91
+
92
+ // FIXME: no super_statement?
87
93
}
88
94
89
95
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
101
107
}
102
108
}
103
109
}
110
+
111
+ // FIXME: no super_local?
104
112
}
105
113
}
0 commit comments