From 09a9ea69bfc381e6cedb9141d1b607b12027e94b Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 15 Mar 2021 23:52:57 +0300 Subject: [PATCH] Update clippy tests --- tests/ui/use_self.fixed | 21 +++++++++++---------- tests/ui/use_self.rs | 21 +++++++++++---------- tests/ui/use_self.stderr | 16 ++-------------- tests/ui/zero_sized_btreemap_values.stderr | 2 +- tests/ui/zero_sized_hashmap_values.stderr | 2 +- 5 files changed, 26 insertions(+), 36 deletions(-) diff --git a/tests/ui/use_self.fixed b/tests/ui/use_self.fixed index a630936e3b1..b94d5448d92 100644 --- a/tests/ui/use_self.fixed +++ b/tests/ui/use_self.fixed @@ -312,17 +312,18 @@ mod issue4140 { fn try_from(value: T) -> Result>; } - impl TryFrom for T - where - T: From, - { - type From = Self; - type To = Self; + // FIXME: Suggested fix results in infinite recursion. + // impl TryFrom for T + // where + // T: From, + // { + // type From = Self::From; + // type To = Self::To; - fn try_from(value: F) -> Result> { - Ok(From::from(value)) - } - } + // fn try_from(value: F) -> Result> { + // Ok(From::from(value)) + // } + // } impl From for i64 { type From = bool; diff --git a/tests/ui/use_self.rs b/tests/ui/use_self.rs index f3e081dd203..ac99c6d9d7b 100644 --- a/tests/ui/use_self.rs +++ b/tests/ui/use_self.rs @@ -312,17 +312,18 @@ mod issue4140 { fn try_from(value: T) -> Result>; } - impl TryFrom for T - where - T: From, - { - type From = T::From; - type To = T::To; + // FIXME: Suggested fix results in infinite recursion. + // impl TryFrom for T + // where + // T: From, + // { + // type From = Self::From; + // type To = Self::To; - fn try_from(value: F) -> Result> { - Ok(From::from(value)) - } - } + // fn try_from(value: F) -> Result> { + // Ok(From::from(value)) + // } + // } impl From for i64 { type From = bool; diff --git a/tests/ui/use_self.stderr b/tests/ui/use_self.stderr index e1410d2e652..a32a9b9157d 100644 --- a/tests/ui/use_self.stderr +++ b/tests/ui/use_self.stderr @@ -157,22 +157,10 @@ LL | Foo { value } | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:319:21 - | -LL | type From = T::From; - | ^^^^^^^ help: use the applicable keyword: `Self` - -error: unnecessary structure name repetition - --> $DIR/use_self.rs:320:19 - | -LL | type To = T::To; - | ^^^^^ help: use the applicable keyword: `Self` - -error: unnecessary structure name repetition - --> $DIR/use_self.rs:453:13 + --> $DIR/use_self.rs:454:13 | LL | A::new::(submod::B {}) | ^ help: use the applicable keyword: `Self` -error: aborting due to 29 previous errors +error: aborting due to 27 previous errors diff --git a/tests/ui/zero_sized_btreemap_values.stderr b/tests/ui/zero_sized_btreemap_values.stderr index 334d921a9af..d924f33797d 100644 --- a/tests/ui/zero_sized_btreemap_values.stderr +++ b/tests/ui/zero_sized_btreemap_values.stderr @@ -83,7 +83,7 @@ error: map with zero-sized value type --> $DIR/zero_sized_btreemap_values.rs:64:35 | LL | let _: BTreeMap = BTreeMap::new(); - | ^^^^^^^^^^^^^ + | ^^^^^^^^ | = help: consider using a set instead diff --git a/tests/ui/zero_sized_hashmap_values.stderr b/tests/ui/zero_sized_hashmap_values.stderr index 43987b3d01d..79770bf90d7 100644 --- a/tests/ui/zero_sized_hashmap_values.stderr +++ b/tests/ui/zero_sized_hashmap_values.stderr @@ -83,7 +83,7 @@ error: map with zero-sized value type --> $DIR/zero_sized_hashmap_values.rs:64:34 | LL | let _: HashMap = HashMap::new(); - | ^^^^^^^^^^^^ + | ^^^^^^^ | = help: consider using a set instead