-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zeroize's cargo test fails immediately #237
Comments
Zeroize crate's derive is broken right now. iqlusioninc/crates#237 Also dalek needs to switch dalek-cryptography/curve25519-dalek#236
These proc macros are used in several projects, although the attribute parser could definitely use some work. Can you provide a failing code example? |
|
I cannot reproduce your issue. The tests also run in CI every time any change is made to this repo:
|
I cut & paste your doc test into the playground : https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bac38f5fb1ac22f94f5094cc2ca47651 |
The
|
Anyways I'll show the bash version:
|
The crate versions I see compiling are all the same (they should be, since Cargo.lock is checked in). What version of Rust are you using? |
Appears the latest nightly:
|
That seems to be the main issue, then. We only test on stable. I'll leave this open for now as I do plan on rewriting the attribute parser before the next release, which may incidentally address this. |
I see. I suppose proc macros have some flux on nightly. |
This is breaking the builds for some of my docs, so I'm going to look into it ASAP. |
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.
zeroize: Improved attribute parser (fixes #237)
I rewrote the attribute parser in #238 and confirmed it passes on nightly. Will release right now as v0.9.3. |
There is seemingly some bug in the proc macros
I must work around this anyways though until dalek adopts zeroize
The text was updated successfully, but these errors were encountered: