Skip to content

Commit 1727c00

Browse files
Assert if inference vars are leaking from fully_resolve
1 parent c07a6a9 commit 1727c00

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)