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

Function derive_inherit_zeroize_on_drop

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

Source from the content-addressed store, hash-verified

248
249#[test]
250fn derive_inherit_zeroize_on_drop() {
251 #[derive(ZeroizeOnDrop)]
252 struct X([u8; 3]);
253
254 #[derive(ZeroizeOnDrop)]
255 struct Z(X);
256
257 let mut value = Z(X([1, 2, 3]));
258 unsafe {
259 ptr::drop_in_place(&raw mut value);
260 }
261 assert_eq!(&value.0.0, &[0, 0, 0]);
262}
263
264#[test]
265fn derive_inherit_from_both() {

Callers

nothing calls this directly

Calls 2

XClass · 0.85
ZClass · 0.70

Tested by

no test coverage detected