mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-19 01:24:05 +00:00
280 lines
9.6 KiB
Text
280 lines
9.6 KiB
Text
error: this bound is already specified as the supertrait of `DerefMut<Target = T>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:13:36
|
|
|
|
|
LL | fn deref_derefmut<T>(x: T) -> impl Deref<Target = T> + DerefMut<Target = T> {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::implied-bounds-in-impls` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::implied_bounds_in_impls)]`
|
|
help: try removing this bound
|
|
|
|
|
LL - fn deref_derefmut<T>(x: T) -> impl Deref<Target = T> + DerefMut<Target = T> {
|
|
LL + fn deref_derefmut<T>(x: T) -> impl DerefMut<Target = T> {
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `GenericSubtrait<U, W, U>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:30:37
|
|
|
|
|
LL | fn generics_implied<U, W>() -> impl GenericTrait<W> + GenericSubtrait<U, W, U>
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn generics_implied<U, W>() -> impl GenericTrait<W> + GenericSubtrait<U, W, U>
|
|
LL + fn generics_implied<U, W>() -> impl GenericSubtrait<U, W, U>
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `GenericSubtrait<(), i32, V>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:36:40
|
|
|
|
|
LL | fn generics_implied_multi<V>() -> impl GenericTrait<i32> + GenericTrait2<V> + GenericSubtrait<(), i32, V> {}
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn generics_implied_multi<V>() -> impl GenericTrait<i32> + GenericTrait2<V> + GenericSubtrait<(), i32, V> {}
|
|
LL + fn generics_implied_multi<V>() -> impl GenericTrait2<V> + GenericSubtrait<(), i32, V> {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `GenericSubtrait<(), i32, V>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:36:60
|
|
|
|
|
LL | fn generics_implied_multi<V>() -> impl GenericTrait<i32> + GenericTrait2<V> + GenericSubtrait<(), i32, V> {}
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn generics_implied_multi<V>() -> impl GenericTrait<i32> + GenericTrait2<V> + GenericSubtrait<(), i32, V> {}
|
|
LL + fn generics_implied_multi<V>() -> impl GenericTrait<i32> + GenericSubtrait<(), i32, V> {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `GenericSubtrait<(), T, V>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:38:44
|
|
|
|
|
LL | fn generics_implied_multi2<T, V>() -> impl GenericTrait<T> + GenericTrait2<V> + GenericSubtrait<(), T, V>
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn generics_implied_multi2<T, V>() -> impl GenericTrait<T> + GenericTrait2<V> + GenericSubtrait<(), T, V>
|
|
LL + fn generics_implied_multi2<T, V>() -> impl GenericTrait2<V> + GenericSubtrait<(), T, V>
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `GenericSubtrait<(), T, V>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:38:62
|
|
|
|
|
LL | fn generics_implied_multi2<T, V>() -> impl GenericTrait<T> + GenericTrait2<V> + GenericSubtrait<(), T, V>
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn generics_implied_multi2<T, V>() -> impl GenericTrait<T> + GenericTrait2<V> + GenericSubtrait<(), T, V>
|
|
LL + fn generics_implied_multi2<T, V>() -> impl GenericTrait<T> + GenericSubtrait<(), T, V>
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `GenericSubtrait<(), i32, ()>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:48:28
|
|
|
|
|
LL | fn generics_same() -> impl GenericTrait<i32> + GenericSubtrait<(), i32, ()> {}
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn generics_same() -> impl GenericTrait<i32> + GenericSubtrait<(), i32, ()> {}
|
|
LL + fn generics_same() -> impl GenericSubtrait<(), i32, ()> {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DerefMut<Target = u8>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:52:20
|
|
|
|
|
LL | fn f() -> impl Deref + DerefMut<Target = u8>;
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f() -> impl Deref + DerefMut<Target = u8>;
|
|
LL + fn f() -> impl DerefMut<Target = u8>;
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DerefMut<Target = u8>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:57:20
|
|
|
|
|
LL | fn f() -> impl Deref + DerefMut<Target = u8> {
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f() -> impl Deref + DerefMut<Target = u8> {
|
|
LL + fn f() -> impl DerefMut<Target = u8> {
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DerefMut<Target = u8>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:63:20
|
|
|
|
|
LL | fn f() -> impl Deref + DerefMut<Target = u8> {
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f() -> impl Deref + DerefMut<Target = u8> {
|
|
LL + fn f() -> impl DerefMut<Target = u8> {
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `PartialOrd`
|
|
--> tests/ui/implied_bounds_in_impls.rs:74:41
|
|
|
|
|
LL | fn default_generic_param1() -> impl PartialEq + PartialOrd + Debug {}
|
|
| ^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn default_generic_param1() -> impl PartialEq + PartialOrd + Debug {}
|
|
LL + fn default_generic_param1() -> impl PartialOrd + Debug {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `PartialOrd`
|
|
--> tests/ui/implied_bounds_in_impls.rs:75:54
|
|
|
|
|
LL | fn default_generic_param2() -> impl PartialOrd + PartialEq + Debug {}
|
|
| ^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn default_generic_param2() -> impl PartialOrd + PartialEq + Debug {}
|
|
LL + fn default_generic_param2() -> impl PartialOrd + Debug {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DoubleEndedIterator`
|
|
--> tests/ui/implied_bounds_in_impls.rs:88:26
|
|
|
|
|
LL | fn my_iter() -> impl Iterator<Item = u32> + DoubleEndedIterator {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn my_iter() -> impl Iterator<Item = u32> + DoubleEndedIterator {
|
|
LL + fn my_iter() -> impl DoubleEndedIterator<Item = u32> {
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `Copy`
|
|
--> tests/ui/implied_bounds_in_impls.rs:93:27
|
|
|
|
|
LL | fn f() -> impl Copy + Clone {
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f() -> impl Copy + Clone {
|
|
LL + fn f() -> impl Copy {
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `Trait2<i32>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:107:21
|
|
|
|
|
LL | fn f2() -> impl Trait1<i32, U = i64> + Trait2<i32> {}
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f2() -> impl Trait1<i32, U = i64> + Trait2<i32> {}
|
|
LL + fn f2() -> impl Trait2<i32, U = i64> {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `Trait4<i8, X = i32>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:122:21
|
|
|
|
|
LL | fn f3() -> impl Trait3<i8, i16, i64, X = i32, Y = i128> + Trait4<i8, X = i32> {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f3() -> impl Trait3<i8, i16, i64, X = i32, Y = i128> + Trait4<i8, X = i32> {}
|
|
LL + fn f3() -> impl Trait4<i8, X = i32, Y = i128> {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `Y`
|
|
--> tests/ui/implied_bounds_in_impls.rs:149:21
|
|
|
|
|
LL | fn f3() -> impl X + Y {}
|
|
| ^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f3() -> impl X + Y {}
|
|
LL + fn f3() -> impl Y {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `Y<T = u32>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:150:21
|
|
|
|
|
LL | fn f4() -> impl X + Y<T = u32> {}
|
|
| ^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f4() -> impl X + Y<T = u32> {}
|
|
LL + fn f4() -> impl Y<T = u32> {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `Y<T = u32>`
|
|
--> tests/ui/implied_bounds_in_impls.rs:151:21
|
|
|
|
|
LL | fn f5() -> impl X<U = String> + Y<T = u32> {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f5() -> impl X<U = String> + Y<T = u32> {}
|
|
LL + fn f5() -> impl Y<T = u32, U = String> {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DerefMut`
|
|
--> tests/ui/implied_bounds_in_impls.rs:154:17
|
|
|
|
|
LL | fn apit(_: impl Deref + DerefMut) {}
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn apit(_: impl Deref + DerefMut) {}
|
|
LL + fn apit(_: impl DerefMut) {}
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DerefMut`
|
|
--> tests/ui/implied_bounds_in_impls.rs:157:20
|
|
|
|
|
LL | fn f() -> impl Deref + DerefMut;
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - fn f() -> impl Deref + DerefMut;
|
|
LL + fn f() -> impl DerefMut;
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DerefMut`
|
|
--> tests/ui/implied_bounds_in_impls.rs:165:23
|
|
|
|
|
LL | type Assoc = impl Deref + DerefMut;
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - type Assoc = impl Deref + DerefMut;
|
|
LL + type Assoc = impl DerefMut;
|
|
|
|
|
|
|
error: this bound is already specified as the supertrait of `DerefMut`
|
|
--> tests/ui/implied_bounds_in_impls.rs:171:18
|
|
|
|
|
LL | type Tait = impl Deref + DerefMut;
|
|
| ^^^^^
|
|
|
|
|
help: try removing this bound
|
|
|
|
|
LL - type Tait = impl Deref + DerefMut;
|
|
LL + type Tait = impl DerefMut;
|
|
|
|
|
|
|
error: aborting due to 23 previous errors
|
|
|