@@ -436,6 +436,17 @@ impl DefCollector<'_> {
436
436
let mut unresolved_macros = mem:: take ( & mut self . unresolved_macros ) ;
437
437
let pos = unresolved_macros. iter ( ) . position ( |directive| {
438
438
if let MacroDirectiveKind :: Attr { ast_id, mod_item, attr, tree } = & directive. kind {
439
+ self . def_map . diagnostics . push ( DefDiagnostic :: unresolved_proc_macro (
440
+ directive. module_id ,
441
+ MacroCallKind :: Attr {
442
+ ast_id : ast_id. ast_id ,
443
+ attr_args : Default :: default ( ) ,
444
+ invoc_attr_index : attr. id . ast_index ,
445
+ is_derive : false ,
446
+ } ,
447
+ None ,
448
+ ) ) ;
449
+
439
450
self . skip_attrs . insert ( ast_id. ast_id . with_value ( * mod_item) , attr. id ) ;
440
451
441
452
let item_tree = tree. item_tree ( self . db ) ;
@@ -1135,19 +1146,7 @@ impl DefCollector<'_> {
1135
1146
1136
1147
let def = match resolver ( path. clone ( ) ) {
1137
1148
Some ( def) if def. is_attribute ( ) => def,
1138
- _ => {
1139
- self . def_map . diagnostics . push ( DefDiagnostic :: unresolved_proc_macro (
1140
- directive. module_id ,
1141
- MacroCallKind :: Attr {
1142
- ast_id,
1143
- attr_args : Default :: default ( ) ,
1144
- invoc_attr_index : attr. id . ast_index ,
1145
- is_derive : false ,
1146
- } ,
1147
- None ,
1148
- ) ) ;
1149
- return true ;
1150
- }
1149
+ _ => return true ,
1151
1150
} ;
1152
1151
if matches ! (
1153
1152
def,
@@ -1389,9 +1388,8 @@ impl DefCollector<'_> {
1389
1388
ast_id. path . clone ( ) ,
1390
1389
) ) ;
1391
1390
}
1392
- MacroDirectiveKind :: Attr { .. } => {
1393
- // FIXME: these should get diagnosed by `reseed_with_unresolved_attribute`
1394
- }
1391
+ // These are diagnosed by `reseed_with_unresolved_attribute`, as that function consumes them
1392
+ MacroDirectiveKind :: Attr { .. } => { }
1395
1393
}
1396
1394
}
1397
1395
0 commit comments