-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Summary
Clippy makes a suggestion to write impl Trait: Trait + Trait
which does not make sense.
Lint Name
type_repetition_in_bounds and trait_duplication_in_bounds
Reproducer
pub trait Trait {}
pub fn f(_a: impl Trait, _b: impl Trait) {}
error: this type has already been used as a bound predicate
--> src/main.rs:3:35
|
3 | pub fn f(_a: impl Trait, _b: impl Trait) {}
| ^^^^^
|
= note: `-D clippy::type-repetition-in-bounds` implied by `-D clippy::pedantic`
= help: consider combining the bounds: `impl Trait: Trait + Trait`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
error: this trait bound is already specified in the where clause
--> src/main.rs:3:19
|
3 | pub fn f(_a: impl Trait, _b: impl Trait) {}
| ^^^^^
|
= note: `-D clippy::trait-duplication-in-bounds` implied by `-D clippy::pedantic`
= help: consider removing this trait bound
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trait_duplication_in_bounds
Version
rustc 1.62.0-nightly (7c4b47696 2022-04-30)
binary: rustc
commit-hash: 7c4b47696907d64eff5621a64eb3c6e795a9ec77
commit-date: 2022-04-30
host: x86_64-unknown-linux-gnu
release: 1.62.0-nightly
LLVM version: 14.0.1
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have