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]); +}