Skip to content

zeroize_derive: Build fails on latest nightly #172

Closed
@devashishdxt

Description

@devashishdxt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    zeroizeIssues affecting the 'zeroize' crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions