@@ -97,32 +97,32 @@ use super::TrustedLen;
9797#[ stable( feature = "rust1" , since = "1.0.0" ) ]
9898#[ rustc_on_unimplemented(
9999 on(
100- _Self = "&[{A}]" ,
100+ Self = "&[{A}]" ,
101101 message = "a slice of type `{Self}` cannot be built since we need to store the elements somewhere" ,
102102 label = "try explicitly collecting into a `Vec<{A}>`" ,
103103 ) ,
104104 on(
105- all( A = "{integer}" , any( _Self = "&[{integral}]" , ) ) ,
105+ all( A = "{integer}" , any( Self = "&[{integral}]" , ) ) ,
106106 message = "a slice of type `{Self}` cannot be built since we need to store the elements somewhere" ,
107107 label = "try explicitly collecting into a `Vec<{A}>`" ,
108108 ) ,
109109 on(
110- _Self = "[{A}]" ,
110+ Self = "[{A}]" ,
111111 message = "a slice of type `{Self}` cannot be built since `{Self}` has no definite size" ,
112112 label = "try explicitly collecting into a `Vec<{A}>`" ,
113113 ) ,
114114 on(
115- all( A = "{integer}" , any( _Self = "[{integral}]" , ) ) ,
115+ all( A = "{integer}" , any( Self = "[{integral}]" , ) ) ,
116116 message = "a slice of type `{Self}` cannot be built since `{Self}` has no definite size" ,
117117 label = "try explicitly collecting into a `Vec<{A}>`" ,
118118 ) ,
119119 on(
120- _Self = "[{A}; _]" ,
120+ Self = "[{A}; _]" ,
121121 message = "an array of type `{Self}` cannot be built directly from an iterator" ,
122122 label = "try collecting into a `Vec<{A}>`, then using `.try_into()`" ,
123123 ) ,
124124 on(
125- all( A = "{integer}" , any( _Self = "[{integral}; _]" , ) ) ,
125+ all( A = "{integer}" , any( Self = "[{integral}; _]" , ) ) ,
126126 message = "an array of type `{Self}` cannot be built directly from an iterator" ,
127127 label = "try collecting into a `Vec<{A}>`, then using `.try_into()`" ,
128128 ) ,
@@ -239,41 +239,38 @@ pub trait FromIterator<A>: Sized {
239239#[ rustc_diagnostic_item = "IntoIterator" ]
240240#[ rustc_on_unimplemented(
241241 on(
242- _Self = "core::ops::range::RangeTo<Idx>" ,
242+ Self = "core::ops::range::RangeTo<Idx>" ,
243243 label = "if you meant to iterate until a value, add a starting value" ,
244244 note = "`..end` is a `RangeTo`, which cannot be iterated on; you might have meant to have a \
245245 bounded `Range`: `0..end`"
246246 ) ,
247247 on(
248- _Self = "core::ops::range::RangeToInclusive<Idx>" ,
248+ Self = "core::ops::range::RangeToInclusive<Idx>" ,
249249 label = "if you meant to iterate until a value (including it), add a starting value" ,
250250 note = "`..=end` is a `RangeToInclusive`, which cannot be iterated on; you might have meant \
251251 to have a bounded `RangeInclusive`: `0..=end`"
252252 ) ,
253253 on(
254- _Self = "[]" ,
254+ Self = "[]" ,
255255 label = "`{Self}` is not an iterator; try calling `.into_iter()` or `.iter()`"
256256 ) ,
257- on( _Self = "&[]" , label = "`{Self}` is not an iterator; try calling `.iter()`" ) ,
257+ on( Self = "&[]" , label = "`{Self}` is not an iterator; try calling `.iter()`" ) ,
258258 on(
259- _Self = "alloc::vec::Vec<T, A>" ,
259+ Self = "alloc::vec::Vec<T, A>" ,
260260 label = "`{Self}` is not an iterator; try calling `.into_iter()` or `.iter()`"
261261 ) ,
262+ on( Self = "&str" , label = "`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`" ) ,
262263 on(
263- _Self = "&str " ,
264+ Self = "alloc::string::String " ,
264265 label = "`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`"
265266 ) ,
266267 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}" ,
272269 note = "if you want to iterate between `start` until a value `end`, use the exclusive range \
273270 syntax `start..end` or the inclusive range syntax `start..=end`"
274271 ) ,
275272 on(
276- _Self = "{float}" ,
273+ Self = "{float}" ,
277274 note = "if you want to iterate between `start` until a value `end`, use the exclusive range \
278275 syntax `start..end` or the inclusive range syntax `start..=end`"
279276 ) ,
0 commit comments