Skip to content

Commit 1500195

Browse files
committed
mbe: Add a test for calling a macro with no function-like rules
1 parent bd5206e commit 1500195

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tests/ui/macros/macro-rules-attr-error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ macro_rules! local_attr {
1010
fn main() {
1111
#[local_attr]
1212
struct S;
13+
14+
local_attr!(arg); //~ ERROR: macro has no rules for function-like invocation
1315
}

tests/ui/macros/macro-rules-attr-error.stderr

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,14 @@ LL | #[local_attr]
99
|
1010
= note: this error originates in the attribute macro `local_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

12-
error: aborting due to 1 previous error
12+
error: macro has no rules for function-like invocation `local_attr!`
13+
--> $DIR/macro-rules-attr-error.rs:14:5
14+
|
15+
LL | macro_rules! local_attr {
16+
| ----------------------- this macro has no rules for function-like invocation
17+
...
18+
LL | local_attr!(arg);
19+
| ^^^^^^^^^^^^^^^^
20+
21+
error: aborting due to 2 previous errors
1322

0 commit comments

Comments
 (0)