Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1d34cdc

Browse files
committed
Diagnose unresolved attribute proc-macros
1 parent 7d51fc4 commit 1d34cdc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

crates/hir-def/src/nameres/collector.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,19 @@ impl DefCollector<'_> {
11381138

11391139
let def = match resolver(path.clone()) {
11401140
Some(def) if def.is_attribute() => def,
1141-
_ => return true,
1141+
_ => {
1142+
self.def_map.diagnostics.push(DefDiagnostic::unresolved_proc_macro(
1143+
directive.module_id,
1144+
MacroCallKind::Attr {
1145+
ast_id,
1146+
attr_args: Default::default(),
1147+
invoc_attr_index: attr.id.ast_index,
1148+
is_derive: false,
1149+
},
1150+
self.proc_macro_err.clone(),
1151+
));
1152+
return true;
1153+
}
11421154
};
11431155
if matches!(
11441156
def,

0 commit comments

Comments
 (0)