add const generics
This commit is contained in:
parent
e8b55a4ad2
commit
49b1971263
1 changed files with 11 additions and 0 deletions
11
src/test/ui/const-generics/coerce_unsized_array.rs
Normal file
11
src/test/ui/const-generics/coerce_unsized_array.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// run-pass
|
||||
#![feature(const_generics)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn foo<const N: usize>(v: &[u8; N]) -> &[u8] {
|
||||
v
|
||||
}
|
||||
|
||||
fn main() {
|
||||
assert_eq!(foo(&[1, 2]), &[1, 2]);
|
||||
}
|
Loading…
Add table
Reference in a new issue