Skip to content

default_trait_access False Positive with TypedBuilder #6858

Closed
@simonsan

Description

@simonsan

Lint name:
clippy::default_trait_access

I tried this code:

error: calling `std::option::Option::default()` is more clear than this expression
   --> src\domain\types\api\match_info_response.rs:233:24
    |
233 | #[derive(Clone, Debug, TypedBuilder, PartialEq, Serialize, Deserialize)]
    |                        ^^^^^^^^^^^^
    |
note: the lint level is defined here
   --> src/lib.rs:3:9
    |
3   | #![deny(clippy::pedantic)]
    |         ^^^^^^^^^^^^^^^^
    = note: `#[deny(clippy::default_trait_access)]` implied by `#[deny(clippy::pedantic)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
    = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

I expected to see this happen:
To not show up

Instead, this happened: See above

Meta

Using cargo +nightly clippy

  • cargo clippy -V: clippy 0.1.52 (45b3c28 2021-03-04)
  • rustc -Vv:
    rustc 1.52.0-nightly (45b3c2851 2021-03-04)
    binary: rustc
    commit-hash: 45b3c28518e4c45dfd12bc2c4400c0d0e9639927
    commit-date: 2021-03-04
    host: x86_64-pc-windows-msvc
    release: 1.52.0-nightly
    LLVM version: 12.0.0
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.I-false-positiveIssue: The lint was triggered on code it shouldn't haveT-macrosType: Issues with macros and macro expansion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions