Prior discussion regarding suffixed nonzero literals: Pre-RFC: ergonomics around NonZeroU* and literals
Would it be possible to permit coersion of unsuffixed numeric literals to nonzero integers? This would permit things like
let _: NonZeroU8 = 50;. More notably, it would greatly reduce the friction when passing a
NonZeroX as a parameter — right now the user has to explicitly construct it even for static cases, where the compiler could plausibly do this automatically.
Zero would be excluded for obvious reasons. I am not proposing a new suffix for nonzero literals, as was the case in the linked thread from a couple years ago.