summaryrefslogtreecommitdiffstats
path: root/tests/ui/repeat-expr/infer.rs
blob: 8197713b97ed0a12af6af82699afd8b963fb7361 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// check-pass

#[derive(Clone, Default)]
struct MaybeCopy<T>(T);

impl Copy for MaybeCopy<u8> {}

fn is_copy<T: Copy>(x: T) {
    println!("{}", std::any::type_name::<T>());
}

fn main() {
    is_copy(MaybeCopy::default());
    [MaybeCopy::default(); 13];
    // didn't work, because `Copy` was only checked in the mir
}