Skip to content

Commit

Permalink
Assert if inference vars are leaking from fully_resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Oct 24, 2022
1 parent c07a6a9 commit 1727c00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,12 @@ impl<'tcx> InferCtxt<'tcx> {
* except during the writeback phase.
*/

resolve::fully_resolve(self, value)
let value = resolve::fully_resolve(self, value);
assert!(
value.as_ref().map_or(true, |value| !value.needs_infer()),
"`{value:?}` is not fully resolved"
);
value
}

pub fn replace_bound_vars_with_fresh_vars<T>(
Expand Down

0 comments on commit 1727c00

Please sign in to comment.