blob: 45407f5e86d5696e77a375a2e79b2a8280490300 [file] [log] [blame]
// Our diagnostics should be able to point to a specific input that caused an invalid
// identifier.
#![feature(macro_metavar_expr_concat)]
// See what we can do without expanding anything
macro_rules! pre_expansion {
($a:ident) => {
${concat("hi", " bye ")};
${concat("hi", "-", "bye")};
${concat($a, "-")};
}
}
macro_rules! post_expansion {
($a:literal) => {
const _: () = ${concat("hi", $a, "bye")};
//~^ ERROR is not generating a valid identifier
}
}
post_expansion!("!");
macro_rules! post_expansion_many {
($a:ident, $b:ident, $c:ident, $d:literal, $e:ident) => {
const _: () = ${concat($a, $b, $c, $d, $e)};
//~^ ERROR is not generating a valid identifier
}
}
post_expansion_many!(a, b, c, ".d", e);
fn main() {}