Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/traits.rs')
-rw-r--r--crates/hir-ty/src/tests/traits.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/traits.rs b/crates/hir-ty/src/tests/traits.rs
index 278666ef35..48a8371bc8 100644
--- a/crates/hir-ty/src/tests/traits.rs
+++ b/crates/hir-ty/src/tests/traits.rs
@@ -124,6 +124,24 @@ async fn test() {
}
#[test]
+fn infer_async_gen_closure() {
+ check_types(
+ r#"
+//- minicore: async_iterator, fn
+//- /main.rs edition:2024
+fn test() {
+ let f = async gen move |x: i32| {
+ yield x + 42;
+ };
+ let a = f(4);
+ a;
+// ^ impl AsyncIterator<Item = i32>
+}
+"#,
+ );
+}
+
+#[test]
fn auto_sized_async_block() {
check_no_mismatches(
r#"