From 49b1971263971db49e821f81bb54991b7de5ab43 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Thu, 23 Jul 2020 10:55:20 +0200 Subject: [PATCH] add const generics --- src/test/ui/const-generics/coerce_unsized_array.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/test/ui/const-generics/coerce_unsized_array.rs diff --git a/src/test/ui/const-generics/coerce_unsized_array.rs b/src/test/ui/const-generics/coerce_unsized_array.rs new file mode 100644 index 00000000000..b28768a5163 --- /dev/null +++ b/src/test/ui/const-generics/coerce_unsized_array.rs @@ -0,0 +1,11 @@ +// run-pass +#![feature(const_generics)] +#![allow(incomplete_features)] + +fn foo(v: &[u8; N]) -> &[u8] { + v +} + +fn main() { + assert_eq!(foo(&[1, 2]), &[1, 2]); +}