Skip to content

default_trait_access suggests invalid syntax #5990

Closed
@adrianheine

Description

@adrianheine
#![deny(clippy::default_trait_access)]
fn main () {
    let x: Vec<u32> = Default::default();
}

clippy suggests std::vec::Vec<u32>::default()

error: comparison operators cannot be chained
 --> src/main.rs:3:36
  |
3 |     let x: Vec<u32> = std::vec::Vec<u32>::default();
  |                                    ^   ^
  |
help: use `::<...>` instead of `<...>` to specify type arguments
  |
3 |     let x: Vec<u32> = std::vec::Vec::<u32>::default();

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions