about summary refs log tree commit diff
path: root/tests/ui/const-generics/uninferred-consts-during-codegen-1.rs
blob: d5ce146394bbe65a0a4ab20b2687e5aa77bf0c33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ run-pass

use std::fmt;

struct Array<T, const N: usize>([T; N]);

impl<T: fmt::Debug, const N: usize> fmt::Debug for Array<T, N> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.debug_list().entries(self.0.iter()).finish()
    }
}

fn main() {
    assert_eq!(format!("{:?}", Array([1, 2, 3])), "[1, 2, 3]");
}