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

Derive macro breaks when using where for trait with comma #614

Closed
CaliViking opened this issue Feb 5, 2023 · 1 comment · Fixed by #626
Closed

Derive macro breaks when using where for trait with comma #614

CaliViking opened this issue Feb 5, 2023 · 1 comment · Fixed by #626

Comments

@CaliViking
Copy link

CaliViking commented Feb 5, 2023

The following works:

#[derive(Encode, Decode)]
pub struct MyStruct<T: Clone> {
    pub a: A,
    pub b: B<T>,
}

Using a where statement does not work:

#[derive(Encode, Decode)]
pub struct MyStruct<T>
where T: Clone,
{
    pub a: A,
    pub b: B<T>,
}

Error:
expected one of `{`, lifetime, or type, found `,`

The issue is made worse by the Rust formatter in VS Code insisting that there is a comma after the 'where' declaration. If not, then I could just remove the comma, but it is automatically inserted

@VictorKoenders
Copy link
Contributor

VictorKoenders commented Feb 6, 2023

Created an issue upstream: bincode-org/virtue#35, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants