Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure. But to solve those idiosyncrasies, you need to abandon backwards compatibility or introduce conflicting syntax.


Not 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).


Pretty sure they discussed this change on Reddit (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.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: