// run-pass #![allow(dead_code)] use std::mem::needs_drop; use std::mem::ManuallyDrop; struct NeedDrop; impl Drop for NeedDrop { fn drop(&mut self) {} } union UnionOk1 { empty: (), value: ManuallyDrop, } union UnionOk2 { value: ManuallyDrop, } #[allow(dead_code)] union UnionOk3 { empty: (), value: T, } trait Foo {} trait ImpliesCopy: Copy {} #[allow(dead_code)] union UnionOk4 { value: T, } fn main() { // NeedDrop should not make needs_drop true assert!(!needs_drop::>()); assert!(!needs_drop::>()); }