diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2019-10-02 18:13:40 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2019-10-02 18:13:40 -0400 |
| commit | 4a49351e8b3552eb28251ede3511d0ff53e650d7 (patch) | |
| tree | a403f7acf9056cd43933031f71d644f148e87e52 | |
| parent | a96bce7c060d9c5215ecdc10d02b34fbc3f8ad35 (diff) | |
| download | rust-4a49351e8b3552eb28251ede3511d0ff53e650d7.tar.gz rust-4a49351e8b3552eb28251ede3511d0ff53e650d7.zip | |
add unsize slice-str coercion
| -rw-r--r-- | src/test/ui/async-await/return-ty-unsize-coercion.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/async-await/return-ty-unsize-coercion.rs b/src/test/ui/async-await/return-ty-unsize-coercion.rs index 8855e2e55ef..b9884416930 100644 --- a/src/test/ui/async-await/return-ty-unsize-coercion.rs +++ b/src/test/ui/async-await/return-ty-unsize-coercion.rs @@ -31,4 +31,15 @@ fn unsize_slice_coercion() { } } +// Unsizing coercion from `&[&str; 1]` to `&[&str]` +fn unsize_slice_str_coercion() { + fn func() -> &'static [&'static str] { + &["hi"] + } + + async fn func() -> &'static [&'static str] { + &["hi"] + } +} + fn main() {} |
