// core::intrinsics_mem::is_copy::() (std lane request; Relax-only intrinsic, folded per // instance): true exactly when T is Copy, never for a Copy-conditional ADT over a non-Copy arg // (std's memcpy paths for extend_from_slice / to_vec / clone rely on it). use core::intrinsics_mem::is_copy; #[derive(Clone, Copy)] struct P(u8, f32); #[derive(Clone)] struct Q(u8); struct G(T); impl Clone for G { fn clone(&self) -> Self { *self } } impl Copy for G {} fn of() -> bool { unsafe { is_copy::() } } #[test] fn is_copy_per_instance() { assert_eq!( [of::(), of::

(), of::<(u8, &str)>(), of::<[P; 3]>(), of::>(), of::>(), of::(), of::<*mut String>()], [true; 8] ); assert_eq!([of::(), of::(), of::>(), of::<&mut u8>(), of::>>(), of::<[String; 2]>()], [false; 6]); }