]> git.lizzy.rs Git - rust.git/blob - tests/ui/useless_conversion.stderr
Fix adjacent code
[rust.git] / tests / ui / useless_conversion.stderr
1 error: useless conversion to the same type: `T`
2   --> $DIR/useless_conversion.rs:7:13
3    |
4 LL |     let _ = T::from(val);
5    |             ^^^^^^^^^^^^ help: consider removing `T::from()`: `val`
6    |
7 note: the lint level is defined here
8   --> $DIR/useless_conversion.rs:3:9
9    |
10 LL | #![deny(clippy::useless_conversion)]
11    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13 error: useless conversion to the same type: `T`
14   --> $DIR/useless_conversion.rs:8:5
15    |
16 LL |     val.into()
17    |     ^^^^^^^^^^ help: consider removing `.into()`: `val`
18
19 error: useless conversion to the same type: `i32`
20   --> $DIR/useless_conversion.rs:20:22
21    |
22 LL |         let _: i32 = 0i32.into();
23    |                      ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
24
25 error: useless conversion to the same type: `std::str::Lines<'_>`
26   --> $DIR/useless_conversion.rs:45:22
27    |
28 LL |     if Some("ok") == lines.into_iter().next() {}
29    |                      ^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `lines`
30
31 error: useless conversion to the same type: `std::str::Lines<'_>`
32   --> $DIR/useless_conversion.rs:50:21
33    |
34 LL |     let mut lines = text.lines().into_iter();
35    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
36
37 error: useless conversion to the same type: `std::str::Lines<'_>`
38   --> $DIR/useless_conversion.rs:56:22
39    |
40 LL |     if Some("ok") == text.lines().into_iter().next() {}
41    |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
42
43 error: useless conversion to the same type: `std::ops::Range<i32>`
44   --> $DIR/useless_conversion.rs:62:13
45    |
46 LL |     let _ = NUMBERS.into_iter().next();
47    |             ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
48
49 error: useless conversion to the same type: `std::ops::Range<i32>`
50   --> $DIR/useless_conversion.rs:67:17
51    |
52 LL |     let mut n = NUMBERS.into_iter();
53    |                 ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
54
55 error: useless conversion to the same type: `std::string::String`
56   --> $DIR/useless_conversion.rs:128:21
57    |
58 LL |     let _: String = "foo".to_string().into();
59    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
60
61 error: useless conversion to the same type: `std::string::String`
62   --> $DIR/useless_conversion.rs:129:21
63    |
64 LL |     let _: String = From::from("foo".to_string());
65    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
66
67 error: useless conversion to the same type: `std::string::String`
68   --> $DIR/useless_conversion.rs:130:13
69    |
70 LL |     let _ = String::from("foo".to_string());
71    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
72
73 error: useless conversion to the same type: `std::string::String`
74   --> $DIR/useless_conversion.rs:131:13
75    |
76 LL |     let _ = String::from(format!("A: {:04}", 123));
77    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
78
79 error: useless conversion to the same type: `std::str::Lines<'_>`
80   --> $DIR/useless_conversion.rs:132:13
81    |
82 LL |     let _ = "".lines().into_iter();
83    |             ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
84
85 error: useless conversion to the same type: `std::vec::IntoIter<i32>`
86   --> $DIR/useless_conversion.rs:133:13
87    |
88 LL |     let _ = vec![1, 2, 3].into_iter().into_iter();
89    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
90
91 error: useless conversion to the same type: `std::string::String`
92   --> $DIR/useless_conversion.rs:134:21
93    |
94 LL |     let _: String = format!("Hello {}", "world").into();
95    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Hello {}", "world")`
96
97 error: useless conversion to the same type: `i32`
98   --> $DIR/useless_conversion.rs:139:13
99    |
100 LL |     let _ = i32::from(a + b) * 3;
101    |             ^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `(a + b)`
102
103 error: useless conversion to the same type: `Foo<'a'>`
104   --> $DIR/useless_conversion.rs:145:23
105    |
106 LL |     let _: Foo<'a'> = s2.into();
107    |                       ^^^^^^^^^ help: consider removing `.into()`: `s2`
108
109 error: useless conversion to the same type: `Foo<'a'>`
110   --> $DIR/useless_conversion.rs:147:13
111    |
112 LL |     let _ = Foo::<'a'>::from(s3);
113    |             ^^^^^^^^^^^^^^^^^^^^ help: consider removing `Foo::<'a'>::from()`: `s3`
114
115 error: useless conversion to the same type: `std::vec::IntoIter<Foo<'a'>>`
116   --> $DIR/useless_conversion.rs:149:13
117    |
118 LL |     let _ = vec![s4, s4, s4].into_iter().into_iter();
119    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![s4, s4, s4].into_iter()`
120
121 error: aborting due to 19 previous errors
122