From 7f76a73a38c5b12e24b2f790b3f3145559d1aec9 Mon Sep 17 00:00:00 2001 From: Giacomo Stevanato Date: Tue, 21 Sep 2021 15:03:34 +0200 Subject: [PATCH] Add regression test --- crates/hir_ty/src/tests/regression.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs index 618499fdc1..2f38d584a1 100644 --- a/crates/hir_ty/src/tests/regression.rs +++ b/crates/hir_ty/src/tests/regression.rs @@ -1177,3 +1177,24 @@ fn multiexp_inner() { "#, ); } + +#[test] +fn macro_expands_to_impl_trait() { + check_no_mismatches( + r#" +trait Foo {} + +macro_rules! ty { + () => { + impl Foo + } +} + +fn foo(_: ty!()) {} + +fn bar() { + foo(()); +} + "#, + ) +}