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

#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]

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]);
}