We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f097c35 commit a6d7eccCopy full SHA for a6d7ecc
compiler/rustc_ast/src/visitors.rs
@@ -59,6 +59,28 @@ macro_rules! make_ast_visitor {
59
$walk(self, node $$($$(, $arg)?)*)
60
}
61
};
62
+ (
63
+ $ty: ty
64
+ $$(, $$($arg: ident)? $$(_ $ignored_arg: ident)?: $arg_ty: ty)*;
65
+ $visit: ident, $walk: ident,
66
+ $flat_map: ident, $walk_flat_map: ident
67
+ ) => {
68
+ make_visit!{
69
+ $ty
70
+ $$(, $$($arg)? $$(_ $ignored_arg)?: $arg_ty)*;
71
+ $visit, $walk
72
+ }
73
+
74
+ macro_if!{$($mut)? {
75
+ fn $flat_map(
76
+ &mut self,
77
+ node: $ty
78
+ $$(, $$($arg)? $$($ignored_arg)?: $arg_ty)*
79
+ ) -> SmallVec<[$ty; 1]> {
80
+ $walk_flat_map(self, node $$(, $$($arg)? $$($ignored_arg)?)*)
81
82
+ }}
83
+ };
84
85
86
macro_rules! P {
0 commit comments