Fix macro expansion for statements w/o semicolon

This commit is contained in:
Edwin Cheng 2021-03-16 13:44:50 +08:00
parent c0a2b4e826
commit 8e07b23b84
10 changed files with 99 additions and 61 deletions

View file

@ -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(