-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.

Description
Playground link: https://play.rust-lang.org/?gist=e93b00dd6c33bf6bbcc035a7be501592&version=stable
macro_rules! foo {
(
$(
bar: {
$($rest:tt)+
}
)+
) => {
$(
bar($($rest)+);
)+
};
}
macro_rules! bar {
(baz: $baz:expr,) => {};
}
fn main() {
foo!{
bar: {
baz: true,
}
}
}
Compiling playground v0.0.1 (file:///playground)
error: expected identifier, found keyword `true`
--> src/main.rs:24:18
|
24 | baz: true,
| ^^^^
error: `<` is interpreted as a start of generic arguments for `true`, not a comparison
--> src/main.rs:24:22
|
24 | baz: true,
| -
| |
| not interpreted as comparison
| interpreted as generic arguments
|
help: if you want to compare the casted value then write:
|
24 | (baz: true),
| ^^^^^^^^^^^
error: aborting due to 2 previous errors
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
kennytm and hanna-kruppe
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.