@@ -23,7 +23,7 @@ use rustc_errors::{Diagnostic, DiagnosticBuilder, DiagnosticMessage, Subdiagnost
23
23
use rustc_hir as hir;
24
24
use rustc_hir:: def_id:: LocalDefId ;
25
25
use rustc_index:: bit_set:: ChunkedBitSet ;
26
- use rustc_index:: vec:: IndexVec ;
26
+ use rustc_index:: vec:: { IndexSlice , IndexVec } ;
27
27
use rustc_infer:: infer:: {
28
28
DefiningAnchor , InferCtxt , NllRegionVariableOrigin , RegionVariableOrigin , TyCtxtInferExt ,
29
29
} ;
@@ -154,7 +154,7 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> &Bor
154
154
let infcx =
155
155
tcx. infer_ctxt ( ) . with_opaque_type_inference ( DefiningAnchor :: Bind ( hir_owner. def_id ) ) . build ( ) ;
156
156
let input_body: & Body < ' _ > = & input_body. borrow ( ) ;
157
- let promoted: & IndexVec < _ , _ > = & promoted. borrow ( ) ;
157
+ let promoted: & IndexSlice < _ , _ > = & promoted. borrow ( ) ;
158
158
let opt_closure_req = do_mir_borrowck ( & infcx, input_body, promoted, false ) . 0 ;
159
159
debug ! ( "mir_borrowck done" ) ;
160
160
@@ -170,7 +170,7 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> &Bor
170
170
fn do_mir_borrowck < ' tcx > (
171
171
infcx : & InferCtxt < ' tcx > ,
172
172
input_body : & Body < ' tcx > ,
173
- input_promoted : & IndexVec < Promoted , Body < ' tcx > > ,
173
+ input_promoted : & IndexSlice < Promoted , Body < ' tcx > > ,
174
174
return_body_with_facts : bool ,
175
175
) -> ( BorrowCheckResult < ' tcx > , Option < Box < BodyWithBorrowckFacts < ' tcx > > > ) {
176
176
let def = input_body. source . with_opt_param ( ) . as_local ( ) . unwrap ( ) ;
@@ -223,7 +223,7 @@ fn do_mir_borrowck<'tcx>(
223
223
// be modified (in place) to contain non-lexical lifetimes. It
224
224
// will have a lifetime tied to the inference context.
225
225
let mut body_owned = input_body. clone ( ) ;
226
- let mut promoted = input_promoted. clone ( ) ;
226
+ let mut promoted = input_promoted. to_owned ( ) ;
227
227
let free_regions =
228
228
nll:: replace_regions_in_mir ( & infcx, param_env, & mut body_owned, & mut promoted) ;
229
229
let body = & body_owned; // no further changes
0 commit comments