-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zeroize: Improved attribute parser (fixes #237)
The previous attribute parser used a hack where it would compare to the s-exp representation of zeroize attributes to determine of they are `drop` or `no_drop`. This was a bit of a hack that broke with a recent nightly, which removed the spaces surrounding the ident. This commit rewrites the attribute parser to properly walk the attribute `syn::Meta` nodes in the AST until it arrives at a `syn::Ident` containing either `drop` or `no_drop`. All other AST nodes will result in a panic. This relaxes the previous restriction that any `#[derive(Zeroize)]` MUST be annotated with either `drop` or `no_drop`. This was put in place because `zeroize` v0.9 switched from default drop to requiring an explicit attribute. However v0.8 was the only version with implict drop, and has been yanked for several weeks. The change is fully backwards compatible and should have no effect on any existing v0.9 users.
- Loading branch information
1 parent
1c16876
commit d94174a
Showing
3 changed files
with
51 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters