@@ -97,32 +97,32 @@ use super::TrustedLen;
97
97
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
98
98
#[ rustc_on_unimplemented(
99
99
on(
100
- _Self = "&[{A}]" ,
100
+ Self = "&[{A}]" ,
101
101
message = "a slice of type `{Self}` cannot be built since we need to store the elements somewhere" ,
102
102
label = "try explicitly collecting into a `Vec<{A}>`" ,
103
103
) ,
104
104
on(
105
- all( A = "{integer}" , any( _Self = "&[{integral}]" , ) ) ,
105
+ all( A = "{integer}" , any( Self = "&[{integral}]" , ) ) ,
106
106
message = "a slice of type `{Self}` cannot be built since we need to store the elements somewhere" ,
107
107
label = "try explicitly collecting into a `Vec<{A}>`" ,
108
108
) ,
109
109
on(
110
- _Self = "[{A}]" ,
110
+ Self = "[{A}]" ,
111
111
message = "a slice of type `{Self}` cannot be built since `{Self}` has no definite size" ,
112
112
label = "try explicitly collecting into a `Vec<{A}>`" ,
113
113
) ,
114
114
on(
115
- all( A = "{integer}" , any( _Self = "[{integral}]" , ) ) ,
115
+ all( A = "{integer}" , any( Self = "[{integral}]" , ) ) ,
116
116
message = "a slice of type `{Self}` cannot be built since `{Self}` has no definite size" ,
117
117
label = "try explicitly collecting into a `Vec<{A}>`" ,
118
118
) ,
119
119
on(
120
- _Self = "[{A}; _]" ,
120
+ Self = "[{A}; _]" ,
121
121
message = "an array of type `{Self}` cannot be built directly from an iterator" ,
122
122
label = "try collecting into a `Vec<{A}>`, then using `.try_into()`" ,
123
123
) ,
124
124
on(
125
- all( A = "{integer}" , any( _Self = "[{integral}; _]" , ) ) ,
125
+ all( A = "{integer}" , any( Self = "[{integral}; _]" , ) ) ,
126
126
message = "an array of type `{Self}` cannot be built directly from an iterator" ,
127
127
label = "try collecting into a `Vec<{A}>`, then using `.try_into()`" ,
128
128
) ,
@@ -239,41 +239,38 @@ pub trait FromIterator<A>: Sized {
239
239
#[ rustc_diagnostic_item = "IntoIterator" ]
240
240
#[ rustc_on_unimplemented(
241
241
on(
242
- _Self = "core::ops::range::RangeTo<Idx>" ,
242
+ Self = "core::ops::range::RangeTo<Idx>" ,
243
243
label = "if you meant to iterate until a value, add a starting value" ,
244
244
note = "`..end` is a `RangeTo`, which cannot be iterated on; you might have meant to have a \
245
245
bounded `Range`: `0..end`"
246
246
) ,
247
247
on(
248
- _Self = "core::ops::range::RangeToInclusive<Idx>" ,
248
+ Self = "core::ops::range::RangeToInclusive<Idx>" ,
249
249
label = "if you meant to iterate until a value (including it), add a starting value" ,
250
250
note = "`..=end` is a `RangeToInclusive`, which cannot be iterated on; you might have meant \
251
251
to have a bounded `RangeInclusive`: `0..=end`"
252
252
) ,
253
253
on(
254
- _Self = "[]" ,
254
+ Self = "[]" ,
255
255
label = "`{Self}` is not an iterator; try calling `.into_iter()` or `.iter()`"
256
256
) ,
257
- on( _Self = "&[]" , label = "`{Self}` is not an iterator; try calling `.iter()`" ) ,
257
+ on( Self = "&[]" , label = "`{Self}` is not an iterator; try calling `.iter()`" ) ,
258
258
on(
259
- _Self = "alloc::vec::Vec<T, A>" ,
259
+ Self = "alloc::vec::Vec<T, A>" ,
260
260
label = "`{Self}` is not an iterator; try calling `.into_iter()` or `.iter()`"
261
261
) ,
262
+ on( Self = "&str" , label = "`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`" ) ,
262
263
on(
263
- _Self = "&str " ,
264
+ Self = "alloc::string::String " ,
264
265
label = "`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`"
265
266
) ,
266
267
on(
267
- _Self = "alloc::string::String" ,
268
- label = "`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`"
269
- ) ,
270
- on(
271
- _Self = "{integral}" ,
268
+ Self = "{integral}" ,
272
269
note = "if you want to iterate between `start` until a value `end`, use the exclusive range \
273
270
syntax `start..end` or the inclusive range syntax `start..=end`"
274
271
) ,
275
272
on(
276
- _Self = "{float}" ,
273
+ Self = "{float}" ,
277
274
note = "if you want to iterate between `start` until a value `end`, use the exclusive range \
278
275
syntax `start..end` or the inclusive range syntax `start..=end`"
279
276
) ,
0 commit comments