summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/coerce_unsized_array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/coerce_unsized_array.rs')
-rw-r--r--tests/ui/const-generics/coerce_unsized_array.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/const-generics/coerce_unsized_array.rs b/tests/ui/const-generics/coerce_unsized_array.rs
new file mode 100644
index 000000000..ffd5eb9d4
--- /dev/null
+++ b/tests/ui/const-generics/coerce_unsized_array.rs
@@ -0,0 +1,8 @@
+// run-pass
+fn foo<const N: usize>(v: &[u8; N]) -> &[u8] {
+ v
+}
+
+fn main() {
+ assert_eq!(foo(&[1, 2]), &[1, 2]);
+}