]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/coerce_unsized_array.rs
Rollup merge of #74872 - JohnTitor:ping-risc-v, r=Mark-Simulacrum
[rust.git] / src / test / ui / const-generics / coerce_unsized_array.rs
1 // run-pass
2 #![feature(const_generics)]
3 #![allow(incomplete_features)]
4
5 fn foo<const N: usize>(v: &[u8; N]) -> &[u8] {
6     v
7 }
8
9 fn main() {
10     assert_eq!(foo(&[1, 2]), &[1, 2]);
11 }