From 8e07b23b84bff16c0decc6f2b80c27862eac6df1 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 16 Mar 2021 13:44:50 +0800 Subject: Fix macro expansion for statements w/o semicolon --- crates/hir_ty/src/tests/macros.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/tests/macros.rs b/crates/hir_ty/src/tests/macros.rs index fb3afaedc..af4f8bb11 100644 --- a/crates/hir_ty/src/tests/macros.rs +++ b/crates/hir_ty/src/tests/macros.rs @@ -215,6 +215,22 @@ fn expr_macro_expanded_in_various_places() { ); } +#[test] +fn expr_macro_expanded_in_stmts() { + check_infer( + r#" + macro_rules! id { ($($es:tt)*) => { $($es)* } } + fn foo() { + id! { let a = (); } + } + "#, + expect![[r#" + !0..8 'leta=();': () + 57..84 '{ ...); } }': () + "#]], + ); +} + #[test] fn infer_type_value_macro_having_same_name() { check_infer( -- cgit v1.2.3