Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/body/tests/block.rs')
-rw-r--r--crates/hir-def/src/body/tests/block.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/hir-def/src/body/tests/block.rs b/crates/hir-def/src/body/tests/block.rs
index 3bba08cfcc..77ac221e59 100644
--- a/crates/hir-def/src/body/tests/block.rs
+++ b/crates/hir-def/src/body/tests/block.rs
@@ -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
+ "#]],
+ )
+}