summary refs log tree commit diff
path: root/compiler/rustc_ast
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-11-15 19:05:18 +0100
committerGitHub <noreply@github.com>2024-11-15 19:05:18 +0100
commita111716c4295d1b0ae7980d9a67237157aa8bf33 (patch)
tree6889095eb7cb01f1205bc814585e95d24293483a /compiler/rustc_ast
parent249a9100a36f8fd8d79f3733cfa8e6aec0d9f9a3 (diff)
parent9fde49b338c2b87fc8e071e8baa0bb429d55b1a9 (diff)
downloadrust-a111716c4295d1b0ae7980d9a67237157aa8bf33.tar.gz
rust-a111716c4295d1b0ae7980d9a67237157aa8bf33.zip
Rollup merge of #133049 - maxcabrajac:visit_precise_capturing_arg, r=compiler-errors
Change Visitor::visit_precise_capturing_arg so it returns a Visitor::Result

r? `@petrochenkov`

related to #128974
Diffstat (limited to 'compiler/rustc_ast')
-rw-r--r--compiler/rustc_ast/src/visit.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs
index 2f8115441de..58497d70a24 100644
--- a/compiler/rustc_ast/src/visit.rs
+++ b/compiler/rustc_ast/src/visit.rs
@@ -200,8 +200,8 @@ pub trait Visitor<'ast>: Sized {
     fn visit_param_bound(&mut self, bounds: &'ast GenericBound, _ctxt: BoundKind) -> Self::Result {
         walk_param_bound(self, bounds)
     }
-    fn visit_precise_capturing_arg(&mut self, arg: &'ast PreciseCapturingArg) {
-        walk_precise_capturing_arg(self, arg);
+    fn visit_precise_capturing_arg(&mut self, arg: &'ast PreciseCapturingArg) -> Self::Result {
+        walk_precise_capturing_arg(self, arg)
     }
     fn visit_poly_trait_ref(&mut self, t: &'ast PolyTraitRef) -> Self::Result {
         walk_poly_trait_ref(self, t)
@@ -730,14 +730,10 @@ pub fn walk_param_bound<'a, V: Visitor<'a>>(visitor: &mut V, bound: &'a GenericB
 pub fn walk_precise_capturing_arg<'a, V: Visitor<'a>>(
     visitor: &mut V,
     arg: &'a PreciseCapturingArg,
-) {
+) -> V::Result {
     match arg {
-        PreciseCapturingArg::Lifetime(lt) => {
-            visitor.visit_lifetime(lt, LifetimeCtxt::GenericArg);
-        }
-        PreciseCapturingArg::Arg(path, id) => {
-            visitor.visit_path(path, *id);
-        }
+        PreciseCapturingArg::Lifetime(lt) => visitor.visit_lifetime(lt, LifetimeCtxt::GenericArg),
+        PreciseCapturingArg::Arg(path, id) => visitor.visit_path(path, *id),
     }
 }