Skip to content

Commit 49b1971

Browse files
authored
add const generics
1 parent e8b55a4 commit 49b1971

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
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)