From 50b767862147ce60d5e1baf48536f663fa8db4c6 Mon Sep 17 00:00:00 2001 From: Shoyu Vanilla Date: Thu, 27 Jun 2024 23:48:15 +0900 Subject: [PATCH] Add a regression test for issue 17199 that causes stack overflow --- crates/hir-ty/src/tests/regression.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs index 3aa94be755..4fcb6062b6 100644 --- a/crates/hir-ty/src/tests/regression.rs +++ b/crates/hir-ty/src/tests/regression.rs @@ -1999,3 +1999,22 @@ where "#, ); } + +#[test] +fn tait_async_stack_overflow_17199() { + check_types( + r#" + //- minicore: fmt, future + type Foo = impl core::fmt::Debug; + + async fn foo() -> Foo { + () + } + + async fn test() { + let t = foo().await; + // ^ impl Debug + } +"#, + ); +}