]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_def/src/macro_expansion_tests/mbe/matching.rs
internal: make sure macro test expand to valid syntax
[rust.git] / crates / hir_def / src / macro_expansion_tests / mbe / matching.rs
index 11317cfa9d5b40014185283bee17fa170f4783cc..5bdabfc598baf4405dc28c269764a60a3cfdb289 100644 (file)
@@ -8,18 +8,18 @@
 fn unary_minus_is_a_literal() {
     check(
         r#"
-macro_rules! m { ($x:literal) => (literal!()); ($x:tt) => (not_a_literal!()); }
+macro_rules! m { ($x:literal) => (literal!();); ($x:tt) => (not_a_literal!();); }
 m!(92);
 m!(-92);
 m!(-9.2);
 m!(--92);
 "#,
         expect![[r#"
-macro_rules! m { ($x:literal) => (literal!()); ($x:tt) => (not_a_literal!()); }
-literal!()
-literal!()
-literal!()
-/* error: leftover tokens */not_a_literal!()
+macro_rules! m { ($x:literal) => (literal!();); ($x:tt) => (not_a_literal!();); }
+literal!();
+literal!();
+literal!();
+/* error: leftover tokens */not_a_literal!();
 "#]],
     )
 }