mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 12:39:31 +03:00
88e96b8814
Enhance `NoSyntaxVarsExprRepeat` by suggesting similarly named metavariables, distinguishing repeatable vs non-repeatable bindings, and listing available repeatable variables when no match exists. Co-authored-by: Esteban Küber <esteban@kuber.com.ar> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
13 lines
335 B
Rust
13 lines
335 B
Rust
//@ run-rustfix
|
|
macro_rules! m {
|
|
(begin $($ard:ident),* end) => {
|
|
[$($ard),*] //~ ERROR attempted to repeat an expression containing no syntax variables matched as repeating at this depth
|
|
//~^ HELP there's a macro metavariable with a similar name
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
let x = 1;
|
|
let _ = m![begin x end];
|
|
}
|