@@ -71,24 +71,24 @@ type BorrowedLocalsResults<'a, 'tcx> = ResultsRefCursor<'a, 'a, 'tcx, MaybeBorro
71
71
72
72
/// Dataflow analysis that determines whether each local requires storage at a
73
73
/// given location; i.e. whether its storage can go away without being observed.
74
- pub struct RequiresStorage < ' mir , ' tcx > {
74
+ pub struct MaybeRequiresStorage < ' mir , ' tcx > {
75
75
body : ReadOnlyBodyAndCache < ' mir , ' tcx > ,
76
76
borrowed_locals : RefCell < BorrowedLocalsResults < ' mir , ' tcx > > ,
77
77
}
78
78
79
- impl < ' mir , ' tcx > RequiresStorage < ' mir , ' tcx > {
79
+ impl < ' mir , ' tcx > MaybeRequiresStorage < ' mir , ' tcx > {
80
80
pub fn new (
81
81
body : ReadOnlyBodyAndCache < ' mir , ' tcx > ,
82
82
borrowed_locals : & ' mir Results < ' tcx , MaybeBorrowedLocals > ,
83
83
) -> Self {
84
- RequiresStorage {
84
+ MaybeRequiresStorage {
85
85
body,
86
86
borrowed_locals : RefCell :: new ( ResultsRefCursor :: new ( * body, borrowed_locals) ) ,
87
87
}
88
88
}
89
89
}
90
90
91
- impl < ' mir , ' tcx > dataflow:: AnalysisDomain < ' tcx > for RequiresStorage < ' mir , ' tcx > {
91
+ impl < ' mir , ' tcx > dataflow:: AnalysisDomain < ' tcx > for MaybeRequiresStorage < ' mir , ' tcx > {
92
92
type Idx = Local ;
93
93
94
94
const NAME : & ' static str = "requires_storage" ;
@@ -106,7 +106,7 @@ impl<'mir, 'tcx> dataflow::AnalysisDomain<'tcx> for RequiresStorage<'mir, 'tcx>
106
106
}
107
107
}
108
108
109
- impl < ' mir , ' tcx > dataflow:: GenKillAnalysis < ' tcx > for RequiresStorage < ' mir , ' tcx > {
109
+ impl < ' mir , ' tcx > dataflow:: GenKillAnalysis < ' tcx > for MaybeRequiresStorage < ' mir , ' tcx > {
110
110
fn before_statement_effect (
111
111
& self ,
112
112
trans : & mut impl GenKill < Self :: Idx > ,
@@ -232,15 +232,15 @@ impl<'mir, 'tcx> dataflow::GenKillAnalysis<'tcx> for RequiresStorage<'mir, 'tcx>
232
232
}
233
233
}
234
234
235
- impl < ' mir , ' tcx > RequiresStorage < ' mir , ' tcx > {
235
+ impl < ' mir , ' tcx > MaybeRequiresStorage < ' mir , ' tcx > {
236
236
/// Kill locals that are fully moved and have not been borrowed.
237
237
fn check_for_move ( & self , trans : & mut impl GenKill < Local > , loc : Location ) {
238
238
let mut visitor = MoveVisitor { trans, borrowed_locals : & self . borrowed_locals } ;
239
239
visitor. visit_location ( self . body , loc) ;
240
240
}
241
241
}
242
242
243
- impl < ' mir , ' tcx > BottomValue for RequiresStorage < ' mir , ' tcx > {
243
+ impl < ' mir , ' tcx > BottomValue for MaybeRequiresStorage < ' mir , ' tcx > {
244
244
/// bottom = dead
245
245
const BOTTOM_VALUE : bool = false ;
246
246
}
0 commit comments