Implement range syntax

Closes #19794

r? @aturon for the first patch
r? @nikomatsakis for the rest
Do we want to do this or stop at the maximum value?