Skip to content

Conversation

@daxpedda
Copy link
Collaborator

@daxpedda daxpedda commented May 9, 2025

This PR adds a new option to ZeroizeOnDrop: no_drop. This will implement ZeroizeOnDrop without implementing Drop. Instead, it will assert that all fields implement ZeroizeOnDrop (not Zeroize!).

The second part of this PR reworks DeriveTrait and moves the ownership of derive related data to the actual TraitImpl instead of it just being a dummy-struct to implement TraitImpl over. Now we have to pass in less parameters to each method and can actually use self to store data.

@daxpedda daxpedda requested a review from ModProg May 9, 2025 14:59
@daxpedda daxpedda force-pushed the zeroize-on-drop-no-drop branch 2 times, most recently from 43ee018 to e3068c7 Compare May 9, 2025 15:02
@ModProg
Copy link
Owner

ModProg commented May 9, 2025

Wondering if we could have the same behavior on field level? Though that could require a better name.

@daxpedda
Copy link
Collaborator Author

daxpedda commented May 9, 2025

Wondering if we could have the same behavior on field level? Though that could require a better name.

That is already the default, in Drop it will detect if it implements Zeroize or ZeroizeOnDrop.

@daxpedda daxpedda force-pushed the zeroize-on-drop-no-drop branch from e3068c7 to 9d4c919 Compare May 9, 2025 15:17
@daxpedda daxpedda merged commit 5470b4f into ModProg:main May 14, 2025
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants