@@ -21,7 +21,7 @@ pub use self::MovedValueUseKind::*;
21
21
use self :: InteriorKind :: * ;
22
22
23
23
use rustc:: front:: map as hir_map;
24
- use rustc:: front:: map:: blocks:: { FnLikeNode , FnParts } ;
24
+ use rustc:: front:: map:: blocks:: FnParts ;
25
25
use rustc:: middle:: cfg;
26
26
use rustc:: middle:: dataflow:: DataFlowContext ;
27
27
use rustc:: middle:: dataflow:: BitwiseOperator ;
@@ -227,25 +227,12 @@ fn build_borrowck_dataflow_data<'a, 'tcx>(this: &mut BorrowckCtxt<'a, 'tcx>,
227
227
move_data : flowed_moves }
228
228
}
229
229
230
- /// This and a `ty::ctxt` is all you need to run the dataflow analyses
231
- /// used in the borrow checker.
232
- pub struct FnPartsWithCFG < ' a > {
233
- pub fn_parts : FnParts < ' a > ,
234
- pub cfg : & ' a cfg:: CFG ,
235
- }
236
-
237
- impl < ' a > FnPartsWithCFG < ' a > {
238
- pub fn from_fn_like ( f : & ' a FnLikeNode ,
239
- g : & ' a cfg:: CFG ) -> FnPartsWithCFG < ' a > {
240
- FnPartsWithCFG { fn_parts : f. to_fn_parts ( ) , cfg : g }
241
- }
242
- }
243
-
244
230
/// Accessor for introspective clients inspecting `AnalysisData` and
245
231
/// the `BorrowckCtxt` itself , e.g. the flowgraph visualizer.
246
232
pub fn build_borrowck_dataflow_data_for_fn < ' a , ' tcx > (
247
233
tcx : & ' a ty:: ctxt < ' tcx > ,
248
- input : FnPartsWithCFG < ' a > )
234
+ fn_parts : FnParts < ' a > ,
235
+ cfg : & cfg:: CFG )
249
236
-> ( BorrowckCtxt < ' a , ' tcx > , AnalysisData < ' a , ' tcx > )
250
237
{
251
238
@@ -260,15 +247,13 @@ pub fn build_borrowck_dataflow_data_for_fn<'a, 'tcx>(
260
247
}
261
248
} ;
262
249
263
- let p = input. fn_parts ;
264
-
265
250
let dataflow_data = build_borrowck_dataflow_data ( & mut bccx,
266
- p . kind ,
267
- & * p . decl ,
268
- input . cfg ,
269
- & * p . body ,
270
- p . span ,
271
- p . id ) ;
251
+ fn_parts . kind ,
252
+ & * fn_parts . decl ,
253
+ cfg,
254
+ & * fn_parts . body ,
255
+ fn_parts . span ,
256
+ fn_parts . id ) ;
272
257
273
258
( bccx, dataflow_data)
274
259
}
0 commit comments