Files
rust/tests/ui/macros/typo-in-repeat-expr.fixed
T
Usman Akinyemi 88e96b8814 rustc_expand: improve diagnostics for non-repeatable metavars in repetition
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>
2026-02-18 20:14:36 +05:30

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];
}