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

enum variant with one or more field causes clippy::let_underscore_untyped on Debug derive #107

Open
KisaragiEffective opened this issue Mar 6, 2023 · 0 comments

Comments

@KisaragiEffective
Copy link

consider this example:

    #[derive(Derivative)]
    #[derivative(Debug)]
    enum X {
        Hi(String)
    }

A warning emitted by clippy::let_underscore_untyped. Generated code:

    #[derivative(Debug)]
    enum X {
        Hi(String),
    }
    #[allow(unused_qualifications)]
    #[allow(clippy::unneeded_field_pattern)]
    impl ::std::fmt::Debug for X {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
            match *self {
                X::Hi(ref __arg_0) => {
                    let mut __debug_trait_builder = __f.debug_tuple("Hi");
                    let _ = __debug_trait_builder.field(&&(*__arg_0));
                    __debug_trait_builder.finish()
                }
            }
        }
    }

version: 2.2.0

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

No branches or pull requests

1 participant