diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-03-15 23:52:57 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-03-16 00:12:38 +0300 |
| commit | e98b7d1bcf7031447bd569dfe4798203e4c3ccda (patch) | |
| tree | 4652b85377a934b702c7864da6710d8ee424dc51 | |
| parent | 7e66e9d6b04d0aa0f7ddaf24b8de379bb431fe6f (diff) | |
| download | rust-e98b7d1bcf7031447bd569dfe4798203e4c3ccda.tar.gz rust-e98b7d1bcf7031447bd569dfe4798203e4c3ccda.zip | |
Update clippy tests
| -rw-r--r-- | src/tools/clippy/tests/ui/use_self.fixed | 23 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/use_self.rs | 23 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/use_self.stderr | 16 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/zero_sized_btreemap_values.stderr | 2 | ||||
| -rw-r--r-- | src/tools/clippy/tests/ui/zero_sized_hashmap_values.stderr | 2 |
5 files changed, 28 insertions, 38 deletions
diff --git a/src/tools/clippy/tests/ui/use_self.fixed b/src/tools/clippy/tests/ui/use_self.fixed index a630936e3b1..b94d5448d92 100644 --- a/src/tools/clippy/tests/ui/use_self.fixed +++ b/src/tools/clippy/tests/ui/use_self.fixed @@ -312,17 +312,18 @@ mod issue4140 { fn try_from(value: T) -> Result<Self, Error<Self::From, Self::To>>; } - impl<F, T> TryFrom<F> for T - where - T: From<F>, - { - type From = Self; - type To = Self; - - fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> { - Ok(From::from(value)) - } - } + // FIXME: Suggested fix results in infinite recursion. + // impl<F, T> TryFrom<F> for T + // where + // T: From<F>, + // { + // type From = Self::From; + // type To = Self::To; + + // fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> { + // Ok(From::from(value)) + // } + // } impl From<bool> for i64 { type From = bool; diff --git a/src/tools/clippy/tests/ui/use_self.rs b/src/tools/clippy/tests/ui/use_self.rs index f3e081dd203..ac99c6d9d7b 100644 --- a/src/tools/clippy/tests/ui/use_self.rs +++ b/src/tools/clippy/tests/ui/use_self.rs @@ -312,17 +312,18 @@ mod issue4140 { fn try_from(value: T) -> Result<Self, Error<Self::From, Self::To>>; } - impl<F, T> TryFrom<F> for T - where - T: From<F>, - { - type From = T::From; - type To = T::To; - - fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> { - Ok(From::from(value)) - } - } + // FIXME: Suggested fix results in infinite recursion. + // impl<F, T> TryFrom<F> for T + // where + // T: From<F>, + // { + // type From = Self::From; + // type To = Self::To; + + // fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> { + // Ok(From::from(value)) + // } + // } impl From<bool> for i64 { type From = bool; diff --git a/src/tools/clippy/tests/ui/use_self.stderr b/src/tools/clippy/tests/ui/use_self.stderr index e1410d2e652..a32a9b9157d 100644 --- a/src/tools/clippy/tests/ui/use_self.stderr +++ b/src/tools/clippy/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>(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/src/tools/clippy/tests/ui/zero_sized_btreemap_values.stderr b/src/tools/clippy/tests/ui/zero_sized_btreemap_values.stderr index 334d921a9af..d924f33797d 100644 --- a/src/tools/clippy/tests/ui/zero_sized_btreemap_values.stderr +++ b/src/tools/clippy/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<String, ()> = BTreeMap::new(); - | ^^^^^^^^^^^^^ + | ^^^^^^^^ | = help: consider using a set instead diff --git a/src/tools/clippy/tests/ui/zero_sized_hashmap_values.stderr b/src/tools/clippy/tests/ui/zero_sized_hashmap_values.stderr index 43987b3d01d..79770bf90d7 100644 --- a/src/tools/clippy/tests/ui/zero_sized_hashmap_values.stderr +++ b/src/tools/clippy/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<String, ()> = HashMap::new(); - | ^^^^^^^^^^^^ + | ^^^^^^^ | = help: consider using a set instead |
