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

Function zeroize_on_enum_second_variant_field

zeroize_derive/src/lib.rs:678–694  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

676 #[test]
677 #[should_panic(expected = "#[zeroize(drop)] attribute is not allowed on enum fields")]
678 fn zeroize_on_enum_second_variant_field() {
679 parse_zeroize_test(stringify!(
680 enum Z {
681 Variant1 {
682 a: String,
683 b: Vec<u8>,
684 c: [u8; 3],
685 },
686 Variant2 {
687 #[zeroize(drop)]
688 a: String,
689 b: Vec<u8>,
690 c: [u8; 3],
691 },
692 }
693 ));
694 }
695
696 #[test]
697 #[should_panic(expected = "#[zeroize(drop)] attribute is not allowed on enum variants")]

Callers

nothing calls this directly

Calls 1

parse_zeroize_testFunction · 0.85

Tested by

no test coverage detected