From 6ed2fd233b569d01169fc888f30c358dd289d260 Mon Sep 17 00:00:00 2001 From: cynecx Date: Sun, 18 Apr 2021 19:56:13 +0200 Subject: hir_ty: keep body::Expander in TyLoweringContext --- crates/hir_ty/src/tests/macros.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'crates/hir_ty/src/tests') diff --git a/crates/hir_ty/src/tests/macros.rs b/crates/hir_ty/src/tests/macros.rs index cbe05a5c1..8de1e229f 100644 --- a/crates/hir_ty/src/tests/macros.rs +++ b/crates/hir_ty/src/tests/macros.rs @@ -1243,3 +1243,29 @@ fn macros_in_type_generics() { "#]], ); } + +#[test] +fn infinitely_recursive_macro_type() { + check_infer( + r#" + struct Bar(T); + + macro_rules! Foo { + () => { Foo!() } + } + + type A = Foo!(); + type B = Bar; + + fn main() { + let a: A; + let b: B; + } + "#, + expect![[r#" + 112..143 '{ ...: B; }': () + 122..123 'a': {unknown} + 136..137 'b': Bar<{unknown}> + "#]], + ); +} -- cgit v1.2.3