File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ impl ItemTree {
104
104
// items and expanded during block DefMap computation
105
105
return Default :: default ( ) ;
106
106
} ,
107
+ ast:: Type ( _ty) => {
108
+ // FIXME: This occurs because macros in type position are treated as inner
109
+ // items and expanded during block DefMap computation
110
+ return Default :: default ( ) ;
111
+ } ,
107
112
ast:: Expr ( e) => {
108
113
// Macros can expand to expressions. We return an empty item tree in this case, but
109
114
// still need to collect inner items.
Original file line number Diff line number Diff line change @@ -189,16 +189,12 @@ impl Ctx {
189
189
block_stack. push( self . source_ast_id_map. ast_id( & block) ) ;
190
190
} ,
191
191
ast:: Item ( item) => {
192
- // FIXME: This triggers for macro calls in expression/pattern
193
- if let Some ( SyntaxKind :: MACRO_TYPE ) = node. parent( ) . map( |p| p. kind( ) ) {
194
- // Ignore macros at type position
195
- } else {
196
- let mod_items = self . lower_mod_item( & item, true ) ;
197
- let current_block = block_stack. last( ) ;
198
- if let ( Some ( mod_items) , Some ( block) ) = ( mod_items, current_block) {
199
- if !mod_items. 0 . is_empty( ) {
200
- self . data( ) . inner_items. entry( * block) . or_default( ) . extend( mod_items. 0 . iter( ) . copied( ) ) ;
201
- }
192
+ // FIXME: This triggers for macro calls in expression/pattern/type position
193
+ let mod_items = self . lower_mod_item( & item, true ) ;
194
+ let current_block = block_stack. last( ) ;
195
+ if let ( Some ( mod_items) , Some ( block) ) = ( mod_items, current_block) {
196
+ if !mod_items. 0 . is_empty( ) {
197
+ self . data( ) . inner_items. entry( * block) . or_default( ) . extend( mod_items. 0 . iter( ) . copied( ) ) ;
202
198
}
203
199
}
204
200
} ,
You can’t perform that action at this time.
0 commit comments