Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

Infer trait bounds for generic derives #243

Open
epage opened this issue Dec 6, 2021 · 0 comments
Open

Infer trait bounds for generic derives #243

epage opened this issue Dec 6, 2021 · 0 comments

Comments

@epage
Copy link
Owner

epage commented Dec 6, 2021

Issue by epage
Tuesday Nov 16, 2021 at 15:07 GMT
Originally opened as clap-rs/clap#3032


Building off of #2769 / #3023, we should allow inferring trait bounds.

So instead of

#[derive(Parser)]
struct Opt<T: Args> {
    #[clap(flatten)]
    inner: T,
}

The user does

#[derive(Parser)]
struct Opt<T> {
    #[clap(flatten)]
    inner: T,
}

like they do with when deriving Copy, Clone, serde types, etc.

See https://serde.rs/attr-bound.html for some inspiration on issues to deal with.

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

No branches or pull requests

1 participant