Skip to content

Commit e98b7d1

Browse files
committed
Update clippy tests
1 parent 7e66e9d commit e98b7d1

File tree

5 files changed

+28
-38
lines changed

5 files changed

+28
-38
lines changed

src/tools/clippy/tests/ui/use_self.fixed

+12-11
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,18 @@ mod issue4140 {
312312
fn try_from(value: T) -> Result<Self, Error<Self::From, Self::To>>;
313313
}
314314

315-
impl<F, T> TryFrom<F> for T
316-
where
317-
T: From<F>,
318-
{
319-
type From = Self;
320-
type To = Self;
321-
322-
fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> {
323-
Ok(From::from(value))
324-
}
325-
}
315+
// FIXME: Suggested fix results in infinite recursion.
316+
// impl<F, T> TryFrom<F> for T
317+
// where
318+
// T: From<F>,
319+
// {
320+
// type From = Self::From;
321+
// type To = Self::To;
322+
323+
// fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> {
324+
// Ok(From::from(value))
325+
// }
326+
// }
326327

327328
impl From<bool> for i64 {
328329
type From = bool;

src/tools/clippy/tests/ui/use_self.rs

+12-11
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,18 @@ mod issue4140 {
312312
fn try_from(value: T) -> Result<Self, Error<Self::From, Self::To>>;
313313
}
314314

315-
impl<F, T> TryFrom<F> for T
316-
where
317-
T: From<F>,
318-
{
319-
type From = T::From;
320-
type To = T::To;
321-
322-
fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> {
323-
Ok(From::from(value))
324-
}
325-
}
315+
// FIXME: Suggested fix results in infinite recursion.
316+
// impl<F, T> TryFrom<F> for T
317+
// where
318+
// T: From<F>,
319+
// {
320+
// type From = Self::From;
321+
// type To = Self::To;
322+
323+
// fn try_from(value: F) -> Result<Self, Error<Self::From, Self::To>> {
324+
// Ok(From::from(value))
325+
// }
326+
// }
326327

327328
impl From<bool> for i64 {
328329
type From = bool;

src/tools/clippy/tests/ui/use_self.stderr

+2-14
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,10 @@ LL | Foo { value }
157157
| ^^^ help: use the applicable keyword: `Self`
158158

159159
error: unnecessary structure name repetition
160-
--> $DIR/use_self.rs:319:21
161-
|
162-
LL | type From = T::From;
163-
| ^^^^^^^ help: use the applicable keyword: `Self`
164-
165-
error: unnecessary structure name repetition
166-
--> $DIR/use_self.rs:320:19
167-
|
168-
LL | type To = T::To;
169-
| ^^^^^ help: use the applicable keyword: `Self`
170-
171-
error: unnecessary structure name repetition
172-
--> $DIR/use_self.rs:453:13
160+
--> $DIR/use_self.rs:454:13
173161
|
174162
LL | A::new::<submod::B>(submod::B {})
175163
| ^ help: use the applicable keyword: `Self`
176164

177-
error: aborting due to 29 previous errors
165+
error: aborting due to 27 previous errors
178166

src/tools/clippy/tests/ui/zero_sized_btreemap_values.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ error: map with zero-sized value type
8383
--> $DIR/zero_sized_btreemap_values.rs:64:35
8484
|
8585
LL | let _: BTreeMap<String, ()> = BTreeMap::new();
86-
| ^^^^^^^^^^^^^
86+
| ^^^^^^^^
8787
|
8888
= help: consider using a set instead
8989

src/tools/clippy/tests/ui/zero_sized_hashmap_values.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ error: map with zero-sized value type
8383
--> $DIR/zero_sized_hashmap_values.rs:64:34
8484
|
8585
LL | let _: HashMap<String, ()> = HashMap::new();
86-
| ^^^^^^^^^^^^
86+
| ^^^^^^^
8787
|
8888
= help: consider using a set instead
8989

0 commit comments

Comments
 (0)