External Publication
Visit Post

Introduce a way to construct Range from start + length

Rust Internals [Unofficial] March 18, 2026
Source

You’re right about the issues with it needing to be Copy and I was sloppy not including the placeholder variable, but I’m not sure I follow why it should be "a"..+25 rather than "a"..+26. If it’s meant to be short for "a"..("a" + 26) then aside from the fact that

  • this should probably be characters rather than strings (as one of the other responses points out), and
  • this doesn’t mean anything at all under the syntax sugar proposal, which was kinda the point of suggesting it (namely: keep it limited to the things which make unambiguous sense with the syntax),

I think it should be +26 and not +25 since .. is an exclusive range so the number is the length of the range and 'a' + 26 is the character after 'z' as it should be.

Discussion in the ATmosphere

Loading comments...