2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `T`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:7:13
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = T::from(val);
|
2018-10-06 16:18:06 +00:00
|
|
|
| ^^^^^^^^^^^^ help: consider removing `T::from()`: `val`
|
|
|
|
|
|
2020-01-31 19:21:10 +00:00
|
|
|
note: the lint level is defined here
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:1:9
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2020-05-17 15:36:26 +00:00
|
|
|
LL | #![deny(clippy::useless_conversion)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-05 04:41:09 +00:00
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `T`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:8:5
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | val.into()
|
2018-10-06 16:18:06 +00:00
|
|
|
| ^^^^^^^^^^ help: consider removing `.into()`: `val`
|
2017-02-05 04:41:09 +00:00
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `i32`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:20:22
|
2017-02-05 04:41:09 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _: i32 = 0i32.into();
|
2017-02-05 04:41:09 +00:00
|
|
|
| ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
|
|
|
|
|
2022-12-29 13:28:34 +00:00
|
|
|
error: useless conversion to the same type: `std::str::Lines<'_>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:50:22
|
2022-12-29 13:28:34 +00:00
|
|
|
|
|
|
|
|
LL | if Some("ok") == lines.into_iter().next() {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `lines`
|
|
|
|
|
|
|
|
error: useless conversion to the same type: `std::str::Lines<'_>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:55:21
|
2022-12-29 13:28:34 +00:00
|
|
|
|
|
|
|
|
LL | let mut lines = text.lines().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
|
|
|
|
|
|
|
|
error: useless conversion to the same type: `std::str::Lines<'_>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:61:22
|
2022-12-29 13:28:34 +00:00
|
|
|
|
|
|
|
|
LL | if Some("ok") == text.lines().into_iter().next() {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
|
|
|
|
|
|
|
|
error: useless conversion to the same type: `std::ops::Range<i32>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:67:13
|
2022-12-29 13:28:34 +00:00
|
|
|
|
|
|
|
|
LL | let _ = NUMBERS.into_iter().next();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
|
|
|
|
|
|
|
|
error: useless conversion to the same type: `std::ops::Range<i32>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:72:17
|
2022-12-29 13:28:34 +00:00
|
|
|
|
|
|
|
|
LL | let mut n = NUMBERS.into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:134:21
|
2017-02-05 04:41:09 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _: String = "foo".to_string().into();
|
2017-02-05 04:41:09 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:135:21
|
2017-02-05 04:41:09 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _: String = From::from("foo".to_string());
|
2017-02-05 04:41:09 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:136:13
|
2017-02-05 04:41:09 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = String::from("foo".to_string());
|
2017-02-05 04:41:09 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:137:13
|
2018-07-30 04:02:05 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = String::from(format!("A: {:04}", 123));
|
2018-08-07 03:37:11 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
|
2018-07-30 04:02:05 +00:00
|
|
|
|
2022-09-22 17:39:38 +00:00
|
|
|
error: useless conversion to the same type: `std::str::Lines<'_>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:138:13
|
2018-07-30 04:02:05 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = "".lines().into_iter();
|
2018-08-07 03:37:11 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::vec::IntoIter<i32>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:139:13
|
2018-08-07 03:37:11 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = vec![1, 2, 3].into_iter().into_iter();
|
2018-07-30 04:02:05 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:140:21
|
2018-10-27 09:01:27 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _: String = format!("Hello {}", "world").into();
|
2018-10-27 09:01:27 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Hello {}", "world")`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `i32`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:145:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = i32::from(a + b) * 3;
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `(a + b)`
|
|
|
|
|
2021-05-20 10:30:31 +00:00
|
|
|
error: useless conversion to the same type: `Foo<'a'>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:151:23
|
2021-05-20 10:30:31 +00:00
|
|
|
|
|
|
|
|
LL | let _: Foo<'a'> = s2.into();
|
|
|
|
| ^^^^^^^^^ help: consider removing `.into()`: `s2`
|
|
|
|
|
|
|
|
error: useless conversion to the same type: `Foo<'a'>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:153:13
|
2021-05-20 10:30:31 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Foo::<'a'>::from(s3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: consider removing `Foo::<'a'>::from()`: `s3`
|
|
|
|
|
|
|
|
error: useless conversion to the same type: `std::vec::IntoIter<Foo<'a'>>`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:155:13
|
2021-05-20 10:30:31 +00:00
|
|
|
|
|
|
|
|
LL | let _ = vec![s4, s4, s4].into_iter().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![s4, s4, s4].into_iter()`
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:187:7
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | b(vec![1, 2].into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:177:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | fn b<T: IntoIterator<Item = i32>>(_: T) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:188:7
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | c(vec![1, 2].into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:178:18
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | fn c(_: impl IntoIterator<Item = i32>) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:189:7
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | d(vec![1, 2].into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:181:12
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | T: IntoIterator<Item = i32>,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:192:7
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | b(vec![1, 2].into_iter().into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`s: `vec![1, 2]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:177:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | fn b<T: IntoIterator<Item = i32>>(_: T) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:193:7
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | b(vec![1, 2].into_iter().into_iter().into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`s: `vec![1, 2]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:177:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | fn b<T: IntoIterator<Item = i32>>(_: T) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-09-25 09:28:58 +00:00
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:239:24
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | foo2::<i32, _>([1, 2, 3].into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2, 3]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:218:12
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | I: IntoIterator<Item = i32> + Helper<X>,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:247:14
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | foo3([1, 2, 3].into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2, 3]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:227:12
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | I: IntoIterator<Item = i32>,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:256:16
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | S1.foo([1, 2].into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2]`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:253:27
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | pub fn foo<I: IntoIterator>(&self, _: I) {}
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:275:44
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | v0.into_iter().interleave_shortest(v1.into_iter());
|
|
|
|
| ^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `v1`
|
|
|
|
|
|
|
|
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
2024-08-24 03:49:09 +00:00
|
|
|
--> tests/ui/useless_conversion.rs:262:20
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
|
LL | J: IntoIterator,
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 28 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|