]> git.proxmox.com Git - rustc.git/blob - tests/ui/repeat-expr/infer.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / repeat-expr / infer.rs
1 // check-pass
2
3 #[derive(Clone, Default)]
4 struct MaybeCopy<T>(T);
5
6 impl Copy for MaybeCopy<u8> {}
7
8 fn is_copy<T: Copy>(x: T) {
9 println!("{}", std::any::type_name::<T>());
10 }
11
12 fn main() {
13 is_copy(MaybeCopy::default());
14 [MaybeCopy::default(); 13];
15 // didn't work, because `Copy` was only checked in the mir
16 }