Implement range syntax

Closes #19794

r? @aturon for the first patch
r? @nikomatsakis for the rest
`uint` doesn't always work for `u64`/`i64` on 32-bit platforms.