summary refs log tree commit diff
path: root/src/test/ui/const-generics/fn-taking-const-generic-array.rs
blob: 8e16221ed4bd25beb197066eed44eb0dc4bd47b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete

use std::fmt::Display;

fn print_slice<T: Display, const N: usize>(slice: &[T; N]) {
    for x in slice.iter() {
        println!("{}", x);
    }
}

fn main() {
    print_slice(&[1, 2, 3]);
}