Skip to content

Commit f49b8b4

Browse files
committed
mbe: Add FIXME for moving macro kind error earlier
1 parent 5a48521 commit f49b8b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_expand/src/mbe/diagnostics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ pub(super) fn failed_to_match_macro(
5858

5959
let Some(BestFailure { token, msg: label, remaining_matcher, .. }) = tracker.best_failure
6060
else {
61+
// FIXME: we should report this at macro resolution time, as we do for
62+
// `resolve_macro_cannot_use_as_attr`. We can do that once we track multiple macro kinds for a
63+
// Def.
6164
if attr_args.is_none() && !rules.iter().any(|rule| matches!(rule, MacroRule::Func { .. })) {
6265
let msg = format!("macro has no rules for function-like invocation `{name}!`");
6366
let mut err = psess.dcx().struct_span_err(sp, msg);

0 commit comments

Comments
 (0)