about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2019-10-02 18:13:40 -0400
committerNiko Matsakis <niko@alum.mit.edu>2019-10-02 18:13:40 -0400
commit4a49351e8b3552eb28251ede3511d0ff53e650d7 (patch)
treea403f7acf9056cd43933031f71d644f148e87e52
parenta96bce7c060d9c5215ecdc10d02b34fbc3f8ad35 (diff)
downloadrust-4a49351e8b3552eb28251ede3511d0ff53e650d7.tar.gz
rust-4a49351e8b3552eb28251ede3511d0ff53e650d7.zip
add unsize slice-str coercion
-rw-r--r--src/test/ui/async-await/return-ty-unsize-coercion.rs11
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() {}