Skip to content

Commit 157975c

Browse files
authored
Rollup merge of #74671 - rust-lang:const-generics-coerce-unsized, r=nikomatsakis
add const generics array coercion test
2 parents 1ed74ee + 49b1971 commit 157975c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
}

0 commit comments

Comments
 (0)