We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4943be commit 0d7a055Copy full SHA for 0d7a055
compiler/rustc_ast/src/visitors.rs
@@ -104,6 +104,22 @@ macro_rules! make_ast_visitor {
104
};
105
}
106
107
+ #[allow(unused)]
108
+ macro_rules! mut_only_visit {
109
+ ($name: ident) => {
110
+ macro_rules! $name {
111
+ ($vis: expr, $arg: expr) => {
112
+ macro_if!{ $($mut)? {
113
+ $name($vis, $arg)
114
+ } else {
115
+ // assign to _ to prevent unused_variable warnings
116
+ {let _ = (&$vis, &$arg);}
117
+ }}
118
+ };
119
+ }
120
121
122
+
123
macro_rules! try_v {
124
($visit: expr) => {
125
macro_if!{$($mut)? { $visit } else { try_visit!($visit) }}
0 commit comments