Skip to content

Deriving Validator on a struct with default type parameters fail to build #299

Description

@jobs62

Hi,

we have a struct difined as followed:

#[derive(Debug, Deserialize, JsonSchema, Validator)]
pub struct PaginationQuery<T = ()> {
    #[serde(flatten)]
    pub args: T,
    ...
}

after updating to validator 0.17, clippy fail to build with message.

error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
note: `#[deny(invalid_type_param_default)]` on by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions