Skip to content

Commit

Permalink
add const generics
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Jul 23, 2020
1 parent e8b55a4 commit 49b1971
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/ui/const-generics/coerce_unsized_array.rs
@@ -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]);
}

0 comments on commit 49b1971

Please sign in to comment.