MCPcopy Create free account
hub / github.com/RustCrypto/utils / derive_enum_only_drop

Function derive_enum_only_drop

zeroize/tests/zeroize_derive.rs:97–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95/// Test that the custom macro actually derived `Drop` for `Z`
96#[test]
97fn derive_enum_only_drop() {
98 #[allow(dead_code)]
99 #[derive(ZeroizeOnDrop)]
100 enum Z {
101 Variant1,
102 Variant2(usize),
103 }
104
105 assert!(core::mem::needs_drop::<Z>());
106}
107
108/// Test that `Drop` is not derived in the following case by defining a
109/// `Drop` impl which should conflict if the custom derive defined one too

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected