Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/macro_expansion_tests/mbe.rs')
| -rw-r--r-- | crates/hir_def/src/macro_expansion_tests/mbe.rs | 93 |
1 files changed, 51 insertions, 42 deletions
diff --git a/crates/hir_def/src/macro_expansion_tests/mbe.rs b/crates/hir_def/src/macro_expansion_tests/mbe.rs index 7a866135b3..953750d360 100644 --- a/crates/hir_def/src/macro_expansion_tests/mbe.rs +++ b/crates/hir_def/src/macro_expansion_tests/mbe.rs @@ -317,32 +317,35 @@ macro_rules! m { ($ i:expr) => { fn bar() { $ i * 3; } } } fn bar() { - 1+2*3; + (1+2)*3; } // [email protected] "fn" // [email protected] "bar" // [email protected] "(" // [email protected] ")" // [email protected] "{" -// [email protected] "1" -// [email protected] "+" -// [email protected] "2" -// [email protected] "*" -// [email protected] "3" -// [email protected] ";" -// [email protected] "}" +// [email protected] "(" +// [email protected] "1" +// [email protected] "+" +// [email protected] "2" +// [email protected] ")" +// [email protected] "*" +// [email protected] "3" +// [email protected] ";" +// [email protected] "}" "#]], ) @@ -722,7 +725,7 @@ macro_rules! m { } fn bar() { - 2+2*baz(3).quux(); + (2+2*baz(3).quux()); } "#]], ) @@ -1370,42 +1373,48 @@ macro_rules! m { } /* parse error: expected identifier */ /* parse error: expected SEMICOLON */ +/* parse error: expected SEMICOLON */ +/* parse error: expected expression */ fn f() { - K::C("0"); + K::(C("0")); } // [email protected] "fn" // [email protected] "f" // [email protected] "(" // [email protected] ")" // [email protected] "{" // [email protected] "K" // [email protected] "::" -// [email protected] "C" -// [email protected] "(" -// [email protected] "\"0\"" -// [email protected] ")" -// [email protected] ";" -// [email protected] "}" +// [email protected] "(" +// [email protected] "C" +// [email protected] "(" +// [email protected] "\"0\"" +// [email protected] ")" +// [email protected] ")" +// [email protected] ";" +// [email protected] "}" "#]], ); @@ -1441,7 +1450,7 @@ fn f() { expect![[r#" macro_rules! m { ($expr:expr) => { map($expr) } } fn f() { - let _ = map(x+foo); + let _ = map((x+foo)); } "#]], ) |