@@ -23,7 +23,7 @@ use rustc_errors::{Diagnostic, DiagnosticBuilder, DiagnosticMessage, Subdiagnost
2323use rustc_hir as hir;
2424use rustc_hir:: def_id:: LocalDefId ;
2525use rustc_index:: bit_set:: ChunkedBitSet ;
26- use rustc_index:: vec:: IndexVec ;
26+ use rustc_index:: vec:: { IndexSlice , IndexVec } ;
2727use rustc_infer:: infer:: {
2828 DefiningAnchor , InferCtxt , NllRegionVariableOrigin , RegionVariableOrigin , TyCtxtInferExt ,
2929} ;
@@ -154,7 +154,7 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> &Bor
154154 let infcx =
155155 tcx. infer_ctxt ( ) . with_opaque_type_inference ( DefiningAnchor :: Bind ( hir_owner. def_id ) ) . build ( ) ;
156156 let input_body: & Body < ' _ > = & input_body. borrow ( ) ;
157- let promoted: & IndexVec < _ , _ > = & promoted. borrow ( ) ;
157+ let promoted: & IndexSlice < _ , _ > = & promoted. borrow ( ) ;
158158 let opt_closure_req = do_mir_borrowck ( & infcx, input_body, promoted, false ) . 0 ;
159159 debug ! ( "mir_borrowck done" ) ;
160160
@@ -170,7 +170,7 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> &Bor
170170fn do_mir_borrowck < ' tcx > (
171171 infcx : & InferCtxt < ' tcx > ,
172172 input_body : & Body < ' tcx > ,
173- input_promoted : & IndexVec < Promoted , Body < ' tcx > > ,
173+ input_promoted : & IndexSlice < Promoted , Body < ' tcx > > ,
174174 return_body_with_facts : bool ,
175175) -> ( BorrowCheckResult < ' tcx > , Option < Box < BodyWithBorrowckFacts < ' tcx > > > ) {
176176 let def = input_body. source . with_opt_param ( ) . as_local ( ) . unwrap ( ) ;
@@ -223,7 +223,7 @@ fn do_mir_borrowck<'tcx>(
223223 // be modified (in place) to contain non-lexical lifetimes. It
224224 // will have a lifetime tied to the inference context.
225225 let mut body_owned = input_body. clone ( ) ;
226- let mut promoted = input_promoted. clone ( ) ;
226+ let mut promoted = input_promoted. to_owned ( ) ;
227227 let free_regions =
228228 nll:: replace_regions_in_mir ( & infcx, param_env, & mut body_owned, & mut promoted) ;
229229 let body = & body_owned; // no further changes
0 commit comments