From b4a832aa47e1031db37d1c00db3aaa3c883ef22e Mon Sep 17 00:00:00 2001 From: lcnr Date: Wed, 20 Jul 2022 10:07:49 +0200 Subject: [PATCH] ignore regions in `codegen_resolve_obligation` --- compiler/rustc_trait_selection/src/traits/codegen.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/codegen.rs b/compiler/rustc_trait_selection/src/traits/codegen.rs index 6ca630b74cc79..c1f53de7744ab 100644 --- a/compiler/rustc_trait_selection/src/traits/codegen.rs +++ b/compiler/rustc_trait_selection/src/traits/codegen.rs @@ -51,7 +51,7 @@ pub fn codegen_fulfill_obligation<'tcx>( // Currently, we use a fulfillment context to completely resolve // all nested obligations. This is because they can inform the // inference of the impl's type parameters. - let mut fulfill_cx = FulfillmentContext::new(); + let mut fulfill_cx = FulfillmentContext::new_ignoring_regions(); let impl_source = selection.map(|predicate| { fulfill_cx.register_predicate_obligation(&infcx, predicate); }); @@ -65,7 +65,7 @@ pub fn codegen_fulfill_obligation<'tcx>( } let impl_source = infcx.resolve_vars_if_possible(impl_source); - let impl_source = infcx.tcx.erase_regions(impl_source); + let impl_source = tcx.erase_regions(impl_source); // Opaque types may have gotten their hidden types constrained, but we can ignore them safely // as they will get constrained elsewhere, too.