Do not leak variables from probe

This commit is contained in:
Michael Goulet 2022-08-17 22:00:53 +00:00
parent 075b3ce89d
commit fee9e9b9d3

View File

@ -105,10 +105,13 @@ pub fn build(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> InheritedBuilder<'tcx> {
let mut fulfillment_ctxt = FulfillmentContext::new_in_snapshot();
fulfillment_ctxt.register_predicate_obligations(infcx, obligations);
if fulfillment_ctxt.select_all_or_error(infcx).is_empty() {
infcx.resolve_vars_if_possible(normalized_fn_sig)
} else {
fn_sig
let normalized_fn_sig =
infcx.resolve_vars_if_possible(normalized_fn_sig);
if !normalized_fn_sig.needs_infer() {
return normalized_fn_sig;
}
}
fn_sig
})
})),
def_id,