From d7b916bf498ef217993e1ba46ad5146c34e078fd Mon Sep 17 00:00:00 2001 From: Boxy Date: Sun, 19 Jan 2025 00:19:42 +0000 Subject: [PATCH] Explain visit_ty_unambig naming --- compiler/rustc_hir/src/intravisit.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index 24cb06a9b2c8..b0d80d0f8092 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -510,11 +510,17 @@ pub trait Visitor<'v>: Sized { pub trait VisitorExt<'v>: Visitor<'v> { /// Extension trait method to visit types in unambiguous positions, this is not /// directly on the [`Visitor`] trait as this method should never be overridden. + /// + /// Named `visit_ty_unambig` instead of `visit_unambig_ty` to aid in discovery + /// by IDes when `v.visit_ty` is written. fn visit_ty_unambig(&mut self, t: &'v Ty<'v>) -> Self::Result { walk_unambig_ty(self, t) } /// Extension trait method to visit consts in unambiguous positions, this is not /// directly on the [`Visitor`] trait as this method should never be overridden. + /// + /// Named `visit_const_arg_unambig` instead of `visit_unambig_const_arg` to aid in + /// discovery by IDes when `v.visit_const_arg` is written. fn visit_const_arg_unambig(&mut self, c: &'v ConstArg<'v>) -> Self::Result { walk_const_arg(self, c) }