@@ -21,7 +21,7 @@ pub use self::MovedValueUseKind::*;
2121use self :: InteriorKind :: * ;
2222
2323use rustc:: front:: map as hir_map;
24- use rustc:: front:: map:: blocks:: { FnLikeNode , FnParts } ;
24+ use rustc:: front:: map:: blocks:: FnParts ;
2525use rustc:: middle:: cfg;
2626use rustc:: middle:: dataflow:: DataFlowContext ;
2727use rustc:: middle:: dataflow:: BitwiseOperator ;
@@ -227,25 +227,12 @@ fn build_borrowck_dataflow_data<'a, 'tcx>(this: &mut BorrowckCtxt<'a, 'tcx>,
227227 move_data : flowed_moves }
228228}
229229
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-
244230/// Accessor for introspective clients inspecting `AnalysisData` and
245231/// the `BorrowckCtxt` itself , e.g. the flowgraph visualizer.
246232pub fn build_borrowck_dataflow_data_for_fn < ' a , ' tcx > (
247233 tcx : & ' a ty:: ctxt < ' tcx > ,
248- input : FnPartsWithCFG < ' a > )
234+ fn_parts : FnParts < ' a > ,
235+ cfg : & cfg:: CFG )
249236 -> ( BorrowckCtxt < ' a , ' tcx > , AnalysisData < ' a , ' tcx > )
250237{
251238
@@ -260,15 +247,13 @@ pub fn build_borrowck_dataflow_data_for_fn<'a, 'tcx>(
260247 }
261248 } ;
262249
263- let p = input. fn_parts ;
264-
265250 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 ) ;
272257
273258 ( bccx, dataflow_data)
274259}
0 commit comments