They're not only unsafe, but as far as I'm aware they're a compiler implementation detail that isn't really supposed to be used in user code (along with rustc_nonnull_optimization_guaranteed). It's actually how NonZero is implemented.
See https://github.com/rust-lang/rust/blob/master/library/core/s...
Ah, that explains things
It would be nice to have a #[range(a..b)] version of this that could be standardized.
I'm surprised how little a Google search turns up for them; the best I found was a mention (but no description or examples) in docs.rs: https://docs.rs/rustc-ap-syntax_pos/634.0.0/rustc_ap_syntax_...
Do these enforce against out-of-bounds values by panicking, the way arrays do? Or are they unsafe?