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

Function derive_bound

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

Source from the content-addressed store, hash-verified

231
232#[test]
233fn derive_bound() {
234 trait T: Zeroize {}
235
236 impl T for u8 {}
237
238 #[derive(Zeroize)]
239 #[zeroize(bound = "X: T")]
240 struct Z<X>(X);
241
242 let mut value = Z(5_u8);
243
244 value.zeroize();
245
246 assert_eq!(value.0, 0);
247}
248
249#[test]
250fn derive_inherit_zeroize_on_drop() {

Callers

nothing calls this directly

Calls 2

ZClass · 0.70
zeroizeMethod · 0.45

Tested by

no test coverage detected