Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/simple.rs')
| -rw-r--r-- | crates/hir-ty/src/tests/simple.rs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/simple.rs b/crates/hir-ty/src/tests/simple.rs index 50a1ecd006..4c5cca2165 100644 --- a/crates/hir-ty/src/tests/simple.rs +++ b/crates/hir-ty/src/tests/simple.rs @@ -3861,3 +3861,42 @@ fn main() { "#]], ); } + +#[test] +fn regression_19196() { + check_infer( + r#" +//- minicore: async_fn +fn async_closure<F: AsyncFnOnce(i32)>(f: F) {} +fn closure<F: FnOnce(i32)>(f: F) {} + +fn main() { + async_closure(async |arg| { + arg; + }); + closure(|arg| { + arg; + }); +} +"#, + expect![[r#" + 38..39 'f': F + 44..46 '{}': () + 74..75 'f': F + 80..82 '{}': () + 94..191 '{ ... }); }': () + 100..113 'async_closure': fn async_closure<impl AsyncFnOnce(i32) -> impl Future<Output = ()>>(impl AsyncFnOnce(i32) -> impl Future<Output = ()>) + 100..147 'async_... })': () + 114..146 'async ... }': impl AsyncFnOnce(i32) -> impl Future<Output = ()> + 121..124 'arg': i32 + 126..146 '{ ... }': () + 136..139 'arg': i32 + 153..160 'closure': fn closure<impl FnOnce(i32)>(impl FnOnce(i32)) + 153..188 'closur... })': () + 161..187 '|arg| ... }': impl FnOnce(i32) + 162..165 'arg': i32 + 167..187 '{ ... }': () + 177..180 'arg': i32 + "#]], + ); +} |