File tree 1 file changed +5
-5
lines changed
compiler/rustc_infer/src/infer
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1195,15 +1195,15 @@ impl<'tcx> InferCtxt<'tcx> {
1195
1195
. var_origin ( vid)
1196
1196
}
1197
1197
1198
- /// Takes ownership of the list of variable regions. This implies
1199
- /// that all the region constraints have already been taken, and
1200
- /// hence that `resolve_regions_and_report_errors` can never be
1201
- /// called. This is used only during NLL processing to "hand off" ownership
1202
- /// of the set of region variables into the NLL region context.
1198
+ /// Clone the list of variable regions. This is used only during NLL processing
1199
+ /// to put the set of region variables into the NLL region context.
1203
1200
pub fn get_region_var_origins ( & self ) -> VarInfos {
1204
1201
let mut inner = self . inner . borrow_mut ( ) ;
1205
1202
let ( var_infos, data) = inner
1206
1203
. region_constraint_storage
1204
+ // We clone instead of taking because borrowck still wants to use
1205
+ // the inference context after calling this for diagnostics
1206
+ // and the new trait solver.
1207
1207
. clone ( )
1208
1208
. expect ( "regions already resolved" )
1209
1209
. with_log ( & mut inner. undo_log )
You can’t perform that action at this time.
0 commit comments