Skip to content

Commit 53881f9

Browse files
authored
Rollup merge of #112356 - Nilstrieb:get-region-var-origins, r=compiler-errors
Fix comment for `get_region_var_origins` #109753 changed the logic but not the comment. r? `@compiler-errors`
2 parents fd6efcf + 0e01088 commit 53881f9

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_infer/src/infer

1 file changed

+5
-5
lines changed

compiler/rustc_infer/src/infer/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1195,15 +1195,15 @@ impl<'tcx> InferCtxt<'tcx> {
11951195
.var_origin(vid)
11961196
}
11971197

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.
12031200
pub fn get_region_var_origins(&self) -> VarInfos {
12041201
let mut inner = self.inner.borrow_mut();
12051202
let (var_infos, data) = inner
12061203
.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.
12071207
.clone()
12081208
.expect("regions already resolved")
12091209
.with_log(&mut inner.undo_log)

0 commit comments

Comments
 (0)