about summary refs log tree commit diff
diff options
context:
space:
mode:
authormaxcabrajac <max@cabrajac.com>2024-11-17 19:48:03 -0300
committermaxcabrajac <max@cabrajac.com>2024-11-17 23:05:07 -0300
commiteb2f1c85b32e591293c8242230ad9bdca9d3c69b (patch)
tree3aaf4854d67599f46fc541d67cb25283573dfb27
parent8b0284afd3735a94878a73ecb6d84be8d3842247 (diff)
downloadrust-eb2f1c85b32e591293c8242230ad9bdca9d3c69b.tar.gz
rust-eb2f1c85b32e591293c8242230ad9bdca9d3c69b.zip
ExprField
-rw-r--r--compiler/rustc_ast/src/mut_visit.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs
index 731e5b601ea..4987e218933 100644
--- a/compiler/rustc_ast/src/mut_visit.rs
+++ b/compiler/rustc_ast/src/mut_visit.rs
@@ -307,6 +307,10 @@ pub trait MutVisitor: Sized {
         walk_mt(self, mt);
     }
 
+    fn visit_expr_field(&mut self, f: &mut ExprField) {
+        walk_expr_field(self, f);
+    }
+
     fn flat_map_expr_field(&mut self, f: ExprField) -> SmallVec<[ExprField; 1]> {
         walk_flat_map_expr_field(self, f)
     }
@@ -1104,16 +1108,20 @@ pub fn walk_flat_map_field_def<T: MutVisitor>(
     smallvec![fd]
 }
 
-pub fn walk_flat_map_expr_field<T: MutVisitor>(
-    vis: &mut T,
-    mut f: ExprField,
-) -> SmallVec<[ExprField; 1]> {
-    let ExprField { ident, expr, span, is_shorthand: _, attrs, id, is_placeholder: _ } = &mut f;
+pub fn walk_expr_field<T: MutVisitor>(vis: &mut T, f: &mut ExprField) {
+    let ExprField { ident, expr, span, is_shorthand: _, attrs, id, is_placeholder: _ } = f;
     vis.visit_id(id);
     visit_attrs(vis, attrs);
     vis.visit_ident(ident);
     vis.visit_expr(expr);
     vis.visit_span(span);
+}
+
+pub fn walk_flat_map_expr_field<T: MutVisitor>(
+    vis: &mut T,
+    mut f: ExprField,
+) -> SmallVec<[ExprField; 1]> {
+    vis.visit_expr_field(&mut f);
     smallvec![f]
 }