3 ms·
Sure. But to solve those idiosyncrasies, you need to abandon backwards compatibility or introduce conflicting syntax.
by Ygg2 6y ago
Sure. But to solve those idiosyncrasies, you need to abandon backwards compatibility or introduce conflicting syntax.
- thayne 6y agoNot necessarily. A new type could be introduced and the old one deprecated. Even without introducing a new type, it could be improved in a backwards compatible way. For example, derive the Copy trait, and add a contains method that takes an owned value instead of a reference (at least as long as the Idx type is Copy).
- Ygg2 6y agoPretty sure they discussed this change on Reddit (https://www.reddit.com/r/rust/comments/ix751t/my_least_favorite_rust_type/ https://www.reddit.com/r/rust/comments/ix751t/my_least_favor...): Here is the discussion > In 2021 edition the compiler team could change the meaning of (3..5) to resolve to a new type. Then if you wanted the old type you have to request it by a fully qualified name or something. And the responses was: > That would be pretty awful. I think it would be better to change IntoIterator and warn for differences in copy and intoiterator in both editions so you can write portable code.