]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/rust-analyzer/crates/hir-def/src/body/tests/block.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / src / tools / rust-analyzer / crates / hir-def / src / body / tests / block.rs
index 3bba08cfcce48bded7405a0473f6219534230890..77ac221e590c5a88001f7c1637befc39a0d9fbb2 100644 (file)
@@ -395,3 +395,25 @@ fn foo() {
         "#]],
     )
 }
+
+#[test]
+fn trailing_expr_macro_expands_stmts() {
+    check_at(
+        r#"
+macro_rules! foo {
+    () => { const FOO: u32 = 0;const BAR: u32 = 0; };
+}
+fn f() {$0
+    foo!{}
+};
+        "#,
+        expect![[r#"
+            block scope
+            BAR: v
+            FOO: v
+
+            crate
+            f: v
+        "#]],
+    )
+}