Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/coercion.rs')
| -rw-r--r-- | crates/hir-ty/src/tests/coercion.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/coercion.rs b/crates/hir-ty/src/tests/coercion.rs index a7f65d4fe8..db06d55278 100644 --- a/crates/hir-ty/src/tests/coercion.rs +++ b/crates/hir-ty/src/tests/coercion.rs @@ -1054,3 +1054,18 @@ fn bar() { "#, ); } + +#[test] +fn async_fn_ret() { + check_no_mismatches( + r#" +//- minicore: coerce_unsized, unsize, future, index, slice, range +async fn foo(a: &[i32]) -> &[i32] { + if true { + return &[]; + } + &a[..0] +} + "#, + ); +} |