From ac56b06b44c3aeb2d64c7ea6caf08973e4892637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sun, 19 Nov 2023 18:07:22 +0000 Subject: [PATCH] fix rebase --- compiler/rustc_hir_typeck/src/expr.rs | 3 ++- compiler/rustc_hir_typeck/src/method/suggest.rs | 1 + compiler/rustc_resolve/src/late/diagnostics.rs | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index 4e5a9ce89a941..d9b27fc13182c 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -2117,7 +2117,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // Only assoc fns that return `Self` let fn_sig = self.tcx.fn_sig(item.def_id).skip_binder(); let ret_ty = fn_sig.output(); - let ret_ty = self.tcx.erase_late_bound_regions(ret_ty); + let ret_ty = + self.tcx.normalize_erasing_late_bound_regions(self.param_env, ret_ty); if !self.can_eq(self.param_env, ret_ty, adt_ty) { return None; } diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index cdb08cfd7d966..db434636f5951 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -2002,6 +2002,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { self.tcx.get_diagnostic_item(sym::BorrowMut), ]; let mut candidate_fields: Vec<_> = fields + .into_iter() .filter_map(|candidate_field| { self.check_for_nested_field_satisfying( span, diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index a4f2446cc740f..d62d7fdcae0c2 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -1749,7 +1749,10 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> { // Only assoc fns that return `Self` let fn_sig = self.r.tcx.fn_sig(item.def_id).skip_binder(); let ret_ty = fn_sig.output(); - let ret_ty = self.r.tcx.erase_late_bound_regions(ret_ty); + let ret_ty = self + .r + .tcx + .normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), ret_ty); let ty::Adt(def, _args) = ret_ty.kind() else { return None; };