File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,16 @@ impl VisitMut for ReplaceSelf {
151
151
152
152
fn visit_item_mut ( & mut self , i : & mut Item ) {
153
153
// Visit `macro_rules!` because locally defined macros can refer to
154
- // `self`. Otherwise, do not recurse into nested items.
154
+ // `self`.
155
+ //
156
+ // Visit `futures::select` and similar select macros, which commonly
157
+ // appear syntactically like an item despite expanding to an expression.
158
+ //
159
+ // Otherwise, do not recurse into nested items.
155
160
if let Item :: Macro ( i) = i {
156
- if i. mac . path . is_ident ( "macro_rules" ) {
161
+ if i. mac . path . is_ident ( "macro_rules" )
162
+ || i. mac . path . segments . last ( ) . unwrap ( ) . ident == "select"
163
+ {
157
164
self . visit_macro_mut ( & mut i. mac )
158
165
}
159
166
}
You can’t perform that action at this time.
0 commit comments