Skip to content

Commit 31f4eb7

Browse files
committed
Document how the compiler should handle using a non-attr macro as an attribute
Inspired by rust-lang/rust#132928
1 parent e43905e commit 31f4eb7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

text/3697-declarative-attribute-macros.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ just like those declared using proc macros.
100100

101101
Adding `attr` rules to an existing macro is a semver-compatible change.
102102

103+
If a user invokes a macro as an attribute and that macro does not have any
104+
`attr` rules, the compiler should give a clear error stating that the macro is
105+
not usable as an attribute because it does not have any `attr` rules.
106+
103107
# Drawbacks
104108
[drawbacks]: #drawbacks
105109

0 commit comments

Comments
 (0)