Skip to content

Commit 6365e5a

Browse files
committed
Auto merge of #102903 - compiler-errors:region-var-leak, r=jackh726
Assert if inference vars are leaking from `InferCtxt::fully_resolve` `InferCtxt::fully_resolve` shouldn't return unresolved inference vars without us at least being aware of it, so make it an assertion now. This should only happen in cases where we used to be returning `ReEmpty`... cc `@jackh726`
2 parents bed4ad6 + 1727c00 commit 6365e5a

File tree

1 file changed

+6
-1
lines changed
  • compiler/rustc_infer/src/infer

1 file changed

+6
-1
lines changed

compiler/rustc_infer/src/infer/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,12 @@ impl<'tcx> InferCtxt<'tcx> {
14691469
* except during the writeback phase.
14701470
*/
14711471

1472-
resolve::fully_resolve(self, value)
1472+
let value = resolve::fully_resolve(self, value);
1473+
assert!(
1474+
value.as_ref().map_or(true, |value| !value.needs_infer()),
1475+
"`{value:?}` is not fully resolved"
1476+
);
1477+
value
14731478
}
14741479

14751480
pub fn replace_bound_vars_with_fresh_vars<T>(

0 commit comments

Comments
 (0)