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

Function derive_inherit_from_both

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

Source from the content-addressed store, hash-verified

263
264#[test]
265fn derive_inherit_from_both() {
266 #[derive(Zeroize, ZeroizeOnDrop)]
267 struct X([u8; 3]);
268
269 #[derive(ZeroizeOnDrop)]
270 struct Z(X);
271
272 let mut value = Z(X([1, 2, 3]));
273 unsafe {
274 ptr::drop_in_place(&raw mut value);
275 }
276 assert_eq!(&value.0.0, &[0, 0, 0]);
277}
278
279#[test]
280fn derive_inherit_both() {

Callers

nothing calls this directly

Calls 2

XClass · 0.85
ZClass · 0.70

Tested by

no test coverage detected