From 0e0367439598f7387a078be46afd189d9ace9d9f Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Wed, 13 Nov 2024 16:24:48 +0000 Subject: [PATCH] Arbitrary self types v2: hacky fix This "fix" indicates that the current approach around `receiver_trait_derefs` may not be good enough for extension traits. This needs more thought before we land this, but pushing this commit meanwhile to see if this PR passes the CI in other ways. --- compiler/rustc_hir_typeck/src/method/probe.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index a9e36d4142c9..f3abfb60fa97 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -768,6 +768,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { self.receiver_trait_derefs = step.autoderefs; self.assemble_probe(&step.self_ty); } + // FIXME this isn't good + self.receiver_trait_derefs = 0; } #[instrument(level = "debug", skip(self))]