From 3bc54baa61b250865701ea56bb1e5fde69af92c0 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Mon, 12 Dec 2022 22:11:33 +0900 Subject: normalize receiver substs and erase the regions use a smaller example --- compiler/rustc_ty_utils/src/instance.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_ty_utils/src/instance.rs') diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index c6f2b16ca21..2da98d33429 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -44,7 +44,13 @@ fn inner_resolve_instance<'tcx>( let result = if let Some(trait_def_id) = tcx.trait_of_item(def.did) { debug!(" => associated item, attempting to find impl in param_env {:#?}", param_env); - resolve_associated_item(tcx, def.did, param_env, trait_def_id, substs) + resolve_associated_item( + tcx, + def.did, + param_env, + trait_def_id, + tcx.normalize_erasing_regions(param_env, substs), + ) } else { let ty = tcx.type_of(def.def_id_for_type_of()); let item_type = tcx.subst_and_normalize_erasing_regions(substs, param_env, ty); -- cgit 1.4.1-3-g733a5