Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

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

@CaliViking

Description

@CaliViking

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions