Skip to content
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_derive: Build fails on latest nightly #172

Closed
devashishdxt opened this issue Apr 1, 2019 · 2 comments
Closed

zeroize_derive: Build fails on latest nightly #172

devashishdxt opened this issue Apr 1, 2019 · 2 comments
Labels
zeroize Issues affecting the 'zeroize' crate

Comments

@devashishdxt
Copy link

If you have following tuple struct:

#[derive(Zeroize, ZeroizeOnDrop)]
struct MyNum(u8);

The build fails with the following error:

#[derive(Zeroize, ZeroizeOnDrop)]
         ^^^^^^^ invalid suffix `usize`

This may be because the generated implementation looks like this:

impl Zeroize for MyNum {
    fn zeroize(&mut self) {
        self.0usize.zeroize()
    }
}

Possible reasons:
Recently, this pull request was merged: rust-lang/rust#59421 which introduced this regression: rust-lang/rust#59553

Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=1fdfb92bcacca661092abdce42cf8810

@tarcieri
Copy link
Collaborator

tarcieri commented Apr 1, 2019

It seems I should've used synstructure to walk the fields of the struct. Not sure if that'd address this in particular, but I'd hope it would at least make it not-my-problem.

@tarcieri tarcieri added the zeroize Issues affecting the 'zeroize' crate label May 23, 2019
@tarcieri
Copy link
Collaborator

This should hopefully be fixed by the move to synstructure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zeroize Issues affecting the 'zeroize' crate
Projects
None yet
Development

No branches or pull requests

2 participants