2024-02-16 20:02:50 +00:00
|
|
|
//@ check-pass
|
2022-04-12 07:28:07 +00:00
|
|
|
|
|
|
|
#[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
|
|
|
|
}
|