From 8972a23f4827e784a9dc2f14435d2bc34197c74b Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 29 Apr 2023 10:09:55 +0000 Subject: Do not recurse into const generic args when resolving self lifetime elision. --- compiler/rustc_resolve/src/late.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_resolve/src') diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 511ae8516a8..b783acc8607 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -2075,6 +2075,10 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> { } visit::walk_ty(self, ty) } + + // A type may have an expression as a const generic argument. + // We do not want to recurse into those. + fn visit_expr(&mut self, _: &'a Expr) {} } let impl_self = self -- cgit 1.4.1-3-g733a5