-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It can't use `maybe_whole`, but it can match `maybe_whole` more closely. Also add a test for a case that wasn't previously covered.
- Loading branch information
1 parent
d919dbe
commit 8ac16c6
Showing
3 changed files
with
44 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
macro_rules! mac { | ||
($attr_item: meta) => { | ||
#[cfg($attr_item)] | ||
//~^ ERROR expected unsuffixed literal or identifier, found `an(arbitrary token stream)` | ||
//~| ERROR expected unsuffixed literal or identifier, found `an(arbitrary token stream)` | ||
struct S; | ||
} | ||
} | ||
|
||
mac!(an(arbitrary token stream)); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
error: expected unsuffixed literal or identifier, found `an(arbitrary token stream)` | ||
--> $DIR/attr-bad-meta-4.rs:3:15 | ||
| | ||
LL | #[cfg($attr_item)] | ||
| ^^^^^^^^^^ | ||
... | ||
LL | mac!(an(arbitrary token stream)); | ||
| -------------------------------- in this macro invocation | ||
| | ||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: expected unsuffixed literal or identifier, found `an(arbitrary token stream)` | ||
--> $DIR/attr-bad-meta-4.rs:3:15 | ||
| | ||
LL | #[cfg($attr_item)] | ||
| ^^^^^^^^^^ | ||
... | ||
LL | mac!(an(arbitrary token stream)); | ||
| -------------------------------- in this macro invocation | ||
| | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 2 previous errors | ||
|