Arbitrary subranges of int types were available in Ada for over 40 years via static enforcement via Spark and compilers were able to optimize them nicely.
For a system language I wish Rust would support such things rather than coming with NonZero hacks.