|
| 1 | +error: creating a shared reference to mutable static is discouraged |
| 2 | + --> tests/ui/useless_conversion.rs:99:20 |
| 3 | + | |
| 4 | +LL | assert_eq!(C.into_iter().next(), Some(1)); |
| 5 | + | ^^^^^^^^^^^^^ shared reference to mutable static |
| 6 | + | |
| 7 | + = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> |
| 8 | + = note: this will be a hard error in the 2024 edition |
| 9 | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior |
| 10 | + = note: `-D static-mut-refs` implied by `-D warnings` |
| 11 | + = help: to override `-D warnings` add `#[allow(static_mut_refs)]` |
| 12 | + |
| 13 | +error: creating a shared reference to mutable static is discouraged |
| 14 | + --> tests/ui/useless_conversion.rs:101:20 |
| 15 | + | |
| 16 | +LL | assert_eq!(C.into_iter().next(), Some(1)); |
| 17 | + | ^^^^^^^^^^^^^ shared reference to mutable static |
| 18 | + | |
| 19 | + = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> |
| 20 | + = note: this will be a hard error in the 2024 edition |
| 21 | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior |
| 22 | + |
| 23 | +error: creating a shared reference to mutable static is discouraged |
| 24 | + --> tests/ui/useless_conversion.rs:103:20 |
| 25 | + | |
| 26 | +LL | assert_eq!(C.next(), Some(1)); |
| 27 | + | ^^^^^^^^ shared reference to mutable static |
| 28 | + | |
| 29 | + = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> |
| 30 | + = note: this will be a hard error in the 2024 edition |
| 31 | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior |
| 32 | + |
| 33 | +error: creating a shared reference to mutable static is discouraged |
| 34 | + --> tests/ui/useless_conversion.rs:105:20 |
| 35 | + | |
| 36 | +LL | assert_eq!(C.next(), Some(2)); |
| 37 | + | ^^^^^^^^ shared reference to mutable static |
| 38 | + | |
| 39 | + = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> |
| 40 | + = note: this will be a hard error in the 2024 edition |
| 41 | + = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior |
| 42 | + |
1 | 43 | error: useless conversion to the same type: `T`
|
2 | 44 | --> tests/ui/useless_conversion.rs:5:13
|
3 | 45 | |
|
@@ -53,178 +95,178 @@ LL | let mut n = NUMBERS.into_iter();
|
53 | 95 | | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
|
54 | 96 |
|
55 | 97 | error: useless conversion to the same type: `std::string::String`
|
56 |
| - --> tests/ui/useless_conversion.rs:132:21 |
| 98 | + --> tests/ui/useless_conversion.rs:136:21 |
57 | 99 | |
|
58 | 100 | LL | let _: String = "foo".to_string().into();
|
59 | 101 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
|
60 | 102 |
|
61 | 103 | error: useless conversion to the same type: `std::string::String`
|
62 |
| - --> tests/ui/useless_conversion.rs:133:21 |
| 104 | + --> tests/ui/useless_conversion.rs:137:21 |
63 | 105 | |
|
64 | 106 | LL | let _: String = From::from("foo".to_string());
|
65 | 107 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
|
66 | 108 |
|
67 | 109 | error: useless conversion to the same type: `std::string::String`
|
68 |
| - --> tests/ui/useless_conversion.rs:134:13 |
| 110 | + --> tests/ui/useless_conversion.rs:138:13 |
69 | 111 | |
|
70 | 112 | LL | let _ = String::from("foo".to_string());
|
71 | 113 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
|
72 | 114 |
|
73 | 115 | error: useless conversion to the same type: `std::string::String`
|
74 |
| - --> tests/ui/useless_conversion.rs:135:13 |
| 116 | + --> tests/ui/useless_conversion.rs:139:13 |
75 | 117 | |
|
76 | 118 | LL | let _ = String::from(format!("A: {:04}", 123));
|
77 | 119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
|
78 | 120 |
|
79 | 121 | error: useless conversion to the same type: `std::str::Lines<'_>`
|
80 |
| - --> tests/ui/useless_conversion.rs:136:13 |
| 122 | + --> tests/ui/useless_conversion.rs:140:13 |
81 | 123 | |
|
82 | 124 | LL | let _ = "".lines().into_iter();
|
83 | 125 | | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
|
84 | 126 |
|
85 | 127 | error: useless conversion to the same type: `std::vec::IntoIter<i32>`
|
86 |
| - --> tests/ui/useless_conversion.rs:137:13 |
| 128 | + --> tests/ui/useless_conversion.rs:141:13 |
87 | 129 | |
|
88 | 130 | LL | let _ = vec![1, 2, 3].into_iter().into_iter();
|
89 | 131 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
|
90 | 132 |
|
91 | 133 | error: useless conversion to the same type: `std::string::String`
|
92 |
| - --> tests/ui/useless_conversion.rs:138:21 |
| 134 | + --> tests/ui/useless_conversion.rs:142:21 |
93 | 135 | |
|
94 | 136 | LL | let _: String = format!("Hello {}", "world").into();
|
95 | 137 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Hello {}", "world")`
|
96 | 138 |
|
97 | 139 | error: useless conversion to the same type: `i32`
|
98 |
| - --> tests/ui/useless_conversion.rs:143:13 |
| 140 | + --> tests/ui/useless_conversion.rs:147:13 |
99 | 141 | |
|
100 | 142 | LL | let _ = i32::from(a + b) * 3;
|
101 | 143 | | ^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `(a + b)`
|
102 | 144 |
|
103 | 145 | error: useless conversion to the same type: `Foo<'a'>`
|
104 |
| - --> tests/ui/useless_conversion.rs:149:23 |
| 146 | + --> tests/ui/useless_conversion.rs:153:23 |
105 | 147 | |
|
106 | 148 | LL | let _: Foo<'a'> = s2.into();
|
107 | 149 | | ^^^^^^^^^ help: consider removing `.into()`: `s2`
|
108 | 150 |
|
109 | 151 | error: useless conversion to the same type: `Foo<'a'>`
|
110 |
| - --> tests/ui/useless_conversion.rs:151:13 |
| 152 | + --> tests/ui/useless_conversion.rs:155:13 |
111 | 153 | |
|
112 | 154 | LL | let _ = Foo::<'a'>::from(s3);
|
113 | 155 | | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `Foo::<'a'>::from()`: `s3`
|
114 | 156 |
|
115 | 157 | error: useless conversion to the same type: `std::vec::IntoIter<Foo<'a'>>`
|
116 |
| - --> tests/ui/useless_conversion.rs:153:13 |
| 158 | + --> tests/ui/useless_conversion.rs:157:13 |
117 | 159 | |
|
118 | 160 | LL | let _ = vec![s4, s4, s4].into_iter().into_iter();
|
119 | 161 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![s4, s4, s4].into_iter()`
|
120 | 162 |
|
121 | 163 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
122 |
| - --> tests/ui/useless_conversion.rs:185:7 |
| 164 | + --> tests/ui/useless_conversion.rs:189:7 |
123 | 165 | |
|
124 | 166 | LL | b(vec![1, 2].into_iter());
|
125 | 167 | | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
|
126 | 168 | |
|
127 | 169 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
128 |
| - --> tests/ui/useless_conversion.rs:175:13 |
| 170 | + --> tests/ui/useless_conversion.rs:179:13 |
129 | 171 | |
|
130 | 172 | LL | fn b<T: IntoIterator<Item = i32>>(_: T) {}
|
131 | 173 | | ^^^^^^^^^^^^^^^^^^^^^^^^
|
132 | 174 |
|
133 | 175 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
134 |
| - --> tests/ui/useless_conversion.rs:186:7 |
| 176 | + --> tests/ui/useless_conversion.rs:190:7 |
135 | 177 | |
|
136 | 178 | LL | c(vec![1, 2].into_iter());
|
137 | 179 | | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
|
138 | 180 | |
|
139 | 181 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
140 |
| - --> tests/ui/useless_conversion.rs:176:18 |
| 182 | + --> tests/ui/useless_conversion.rs:180:18 |
141 | 183 | |
|
142 | 184 | LL | fn c(_: impl IntoIterator<Item = i32>) {}
|
143 | 185 | | ^^^^^^^^^^^^^^^^^^^^^^^^
|
144 | 186 |
|
145 | 187 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
146 |
| - --> tests/ui/useless_conversion.rs:187:7 |
| 188 | + --> tests/ui/useless_conversion.rs:191:7 |
147 | 189 | |
|
148 | 190 | LL | d(vec![1, 2].into_iter());
|
149 | 191 | | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
|
150 | 192 | |
|
151 | 193 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
152 |
| - --> tests/ui/useless_conversion.rs:179:12 |
| 194 | + --> tests/ui/useless_conversion.rs:183:12 |
153 | 195 | |
|
154 | 196 | LL | T: IntoIterator<Item = i32>,
|
155 | 197 | | ^^^^^^^^^^^^^^^^^^^^^^^^
|
156 | 198 |
|
157 | 199 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
158 |
| - --> tests/ui/useless_conversion.rs:190:7 |
| 200 | + --> tests/ui/useless_conversion.rs:194:7 |
159 | 201 | |
|
160 | 202 | LL | b(vec![1, 2].into_iter().into_iter());
|
161 | 203 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`s: `vec![1, 2]`
|
162 | 204 | |
|
163 | 205 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
164 |
| - --> tests/ui/useless_conversion.rs:175:13 |
| 206 | + --> tests/ui/useless_conversion.rs:179:13 |
165 | 207 | |
|
166 | 208 | LL | fn b<T: IntoIterator<Item = i32>>(_: T) {}
|
167 | 209 | | ^^^^^^^^^^^^^^^^^^^^^^^^
|
168 | 210 |
|
169 | 211 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
170 |
| - --> tests/ui/useless_conversion.rs:191:7 |
| 212 | + --> tests/ui/useless_conversion.rs:195:7 |
171 | 213 | |
|
172 | 214 | LL | b(vec![1, 2].into_iter().into_iter().into_iter());
|
173 | 215 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`s: `vec![1, 2]`
|
174 | 216 | |
|
175 | 217 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
176 |
| - --> tests/ui/useless_conversion.rs:175:13 |
| 218 | + --> tests/ui/useless_conversion.rs:179:13 |
177 | 219 | |
|
178 | 220 | LL | fn b<T: IntoIterator<Item = i32>>(_: T) {}
|
179 | 221 | | ^^^^^^^^^^^^^^^^^^^^^^^^
|
180 | 222 |
|
181 | 223 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
182 |
| - --> tests/ui/useless_conversion.rs:237:24 |
| 224 | + --> tests/ui/useless_conversion.rs:241:24 |
183 | 225 | |
|
184 | 226 | LL | foo2::<i32, _>([1, 2, 3].into_iter());
|
185 | 227 | | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2, 3]`
|
186 | 228 | |
|
187 | 229 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
188 |
| - --> tests/ui/useless_conversion.rs:216:12 |
| 230 | + --> tests/ui/useless_conversion.rs:220:12 |
189 | 231 | |
|
190 | 232 | LL | I: IntoIterator<Item = i32> + Helper<X>,
|
191 | 233 | | ^^^^^^^^^^^^^^^^^^^^^^^^
|
192 | 234 |
|
193 | 235 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
194 |
| - --> tests/ui/useless_conversion.rs:245:14 |
| 236 | + --> tests/ui/useless_conversion.rs:249:14 |
195 | 237 | |
|
196 | 238 | LL | foo3([1, 2, 3].into_iter());
|
197 | 239 | | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2, 3]`
|
198 | 240 | |
|
199 | 241 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
200 |
| - --> tests/ui/useless_conversion.rs:225:12 |
| 242 | + --> tests/ui/useless_conversion.rs:229:12 |
201 | 243 | |
|
202 | 244 | LL | I: IntoIterator<Item = i32>,
|
203 | 245 | | ^^^^^^^^^^^^^^^^^^^^^^^^
|
204 | 246 |
|
205 | 247 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
206 |
| - --> tests/ui/useless_conversion.rs:254:16 |
| 248 | + --> tests/ui/useless_conversion.rs:258:16 |
207 | 249 | |
|
208 | 250 | LL | S1.foo([1, 2].into_iter());
|
209 | 251 | | ^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2]`
|
210 | 252 | |
|
211 | 253 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
212 |
| - --> tests/ui/useless_conversion.rs:251:27 |
| 254 | + --> tests/ui/useless_conversion.rs:255:27 |
213 | 255 | |
|
214 | 256 | LL | pub fn foo<I: IntoIterator>(&self, _: I) {}
|
215 | 257 | | ^^^^^^^^^^^^
|
216 | 258 |
|
217 | 259 | error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
|
218 |
| - --> tests/ui/useless_conversion.rs:273:44 |
| 260 | + --> tests/ui/useless_conversion.rs:277:44 |
219 | 261 | |
|
220 | 262 | LL | v0.into_iter().interleave_shortest(v1.into_iter());
|
221 | 263 | | ^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `v1`
|
222 | 264 | |
|
223 | 265 | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
|
224 |
| - --> tests/ui/useless_conversion.rs:260:20 |
| 266 | + --> tests/ui/useless_conversion.rs:264:20 |
225 | 267 | |
|
226 | 268 | LL | J: IntoIterator,
|
227 | 269 | | ^^^^^^^^^^^^
|
228 | 270 |
|
229 |
| -error: aborting due to 28 previous errors |
| 271 | +error: aborting due to 32 previous errors |
230 | 272 |
|
0 commit comments