@@ -152,17 +152,20 @@ However, this is simply not possible.
152
152
You can't have a trait implementation exist in one edition and not in another,
153
153
since editions can be mixed.
154
154
155
- Instead, we decided to add the trait implementation in all editions (starting in Rust 1.53.0),
155
+ Instead, we decided to add the trait implementation in * all* editions (starting in Rust 1.53.0),
156
156
but add a small hack to avoid breakage until Rust 2021.
157
157
In Rust 2015 and 2018 code, the compiler will still resolve ` array.into_iter() `
158
158
to ` (&array).into_iter() ` like before, as if the trait implementation does not exist.
159
159
This * only* applies to the ` .into_iter() ` method call syntax.
160
- It does not affect any other syntax such as ` for e in [1, 2, 3] ` or ` iter.zip([1, 2, 3]) ` .
160
+ It does not affect any other syntax such as ` for e in [1, 2, 3] ` , ` iter.zip([1, 2, 3]) ` or
161
+ ` IntoIterator::into_iter([1, 2, 3]) ` .
161
162
Those will start to work in * all* editions.
162
163
163
164
While it's a shame that this required a small hack to avoid breakage,
164
165
we're very happy with how this solution keeps the difference between
165
166
the editions to an absolute minimum.
167
+ Since the hack is only present in the older editions,
168
+ there is no added complexity in the new edition.
166
169
167
170
[ 25 ] : https://github.com/rust-lang/rust/issues/25725
168
171
[ 20 ] : https://github.com/rust-lang/rust/pull/65819
@@ -248,7 +251,7 @@ To make space for some new syntax in the future,
248
251
we've decided to reserve syntax for prefixed identifiers and literals:
249
252
` prefix#identifier ` , ` prefix"string" ` , ` prefix'c' ` , and ` prefix#123 ` ,
250
253
where ` prefix ` can be any identifier.
251
- (Except those that already have a meaning, such as ` b'' ` and ` r"" ` .)
254
+ (Except those that already have a meaning, such as ` b'… ' ` and ` r"… " ` .)
252
255
253
256
This is a breaking change, since macros can currently accept ` hello"world" ` ,
254
257
which they will see as two separate tokens: ` hello ` and ` "world" ` .
0 commit comments