From 1727c00f1a810cae447e12bb564110527450219c Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 10 Oct 2022 22:39:41 +0000 Subject: [PATCH] Assert if inference vars are leaking from fully_resolve --- compiler/rustc_infer/src/infer/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 2732c92ecd3..7e2ea6c0e26 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -1469,7 +1469,12 @@ pub fn fully_resolve>(&self, value: T) -> FixupResult<'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(