Skip to content

Commit 085e511

Browse files
committed
mbe: Fix error message for using a macro with no attr rules as an attribute
Avoid saying "a declarative macro cannot be used as an attribute macro"; instead, say that the macro has no `attr` rules.
1 parent 38c940e commit 085e511

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_resolve/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ resolve_lowercase_self =
246246
.suggestion = try using `Self`
247247
248248
resolve_macro_cannot_use_as_attr =
249-
`{$ident}` exists, but a declarative macro cannot be used as an attribute macro
249+
`{$ident}` exists, but has no `attr` rules
250250
251251
resolve_macro_cannot_use_as_derive =
252252
`{$ident}` exists, but a declarative macro cannot be used as a derive macro

tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error: cannot find attribute `sample` in this scope
1111
--> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:5:3
1212
|
1313
LL | macro_rules! sample { () => {} }
14-
| ------ `sample` exists, but a declarative macro cannot be used as an attribute macro
14+
| ------ `sample` exists, but has no `attr` rules
1515
LL |
1616
LL | #[sample]
1717
| ^^^^^^

0 commit comments

Comments
 (0)