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

default_trait_access suggests invalid syntax #5990

Closed
adrianheine opened this issue Aug 31, 2020 · 0 comments · Fixed by #5993
Closed

default_trait_access suggests invalid syntax #5990

adrianheine opened this issue Aug 31, 2020 · 0 comments · Fixed by #5993
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@adrianheine
Copy link

#![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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant