@@ -421,15 +421,15 @@ impl DefCollector<'_> {
421
421
}
422
422
}
423
423
424
- /// When the fixed-point loop reaches a stable state, we might still have some unresolved
425
- /// attributes (or unexpanded attribute proc macros) left over. This takes one of them, and
426
- /// feeds the item it's applied to back into name resolution.
424
+ /// When the fixed-point loop reaches a stable state, we might still have
425
+ /// some unresolved attributes left over. This takes one of them, and feeds
426
+ /// the item it's applied to back into name resolution.
427
427
///
428
428
/// This effectively ignores the fact that the macro is there and just treats the items as
429
429
/// normal code.
430
430
///
431
- /// This improves UX when proc macros are turned off or don't work , and replicates the behavior
432
- /// before we supported proc. attribute macros.
431
+ /// This improves UX for unresolved attributes , and replicates the
432
+ /// behavior before we supported proc. attribute macros.
433
433
fn reseed_with_unresolved_attribute ( & mut self ) -> ReachedFixedPoint {
434
434
cov_mark:: hit!( unresolved_attribute_fallback) ;
435
435
@@ -1229,6 +1229,7 @@ impl DefCollector<'_> {
1229
1229
) ;
1230
1230
let loc: MacroCallLoc = self . db . lookup_intern_macro_call ( call_id) ;
1231
1231
1232
+ // If proc attribute macro expansion is disabled, skip expanding it here
1232
1233
if !self . db . enable_proc_attr_macros ( ) {
1233
1234
self . def_map . diagnostics . push ( DefDiagnostic :: unresolved_proc_macro (
1234
1235
directive. module_id ,
@@ -1250,8 +1251,10 @@ impl DefCollector<'_> {
1250
1251
1251
1252
if let MacroDefKind :: ProcMacro ( exp, ..) = loc. def . kind {
1252
1253
if exp. is_dummy ( ) {
1253
- // Proc macros that cannot be expanded are treated as not
1254
- // resolved, in order to fall back later.
1254
+ // If there's no expander for the proc macro (e.g.
1255
+ // because proc macros are disabled, or building the
1256
+ // proc macro crate failed), report this and skip
1257
+ // expansion like we would if it was disabled
1255
1258
self . def_map . diagnostics . push ( DefDiagnostic :: unresolved_proc_macro (
1256
1259
directive. module_id ,
1257
1260
loc. kind ,
0 commit comments