-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-macro_metavar_expr`#![feature(macro_metavar_expr)]``#![feature(macro_metavar_expr)]`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.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
Currently when a metavariable expression is used outside of any repetitions, it produces a somewhat cryptic error message instead of saying its not within a repetitions, example:
#![feature(macro_metavar_expr)]
macro_rules! f {
($n:ident) => {
${length()};
}
}
fn main() {
f!(a);
}
error: length depth must be less than 0
--> src/main.rs:5:10
|
5 | ${length()};
| ^^^^^^^^^^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-macro_metavar_expr`#![feature(macro_metavar_expr)]``#![feature(macro_metavar_expr)]`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.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.