]> git.lizzy.rs Git - rust.git/blob - src/test/ui/repeat-expr/infer.rs
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / 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 }