3 ms·
Rust doesn't yet have type level integers, so that'll have to be saved for a future contest. (It's highly desired, and there's an RFC open, but it's not clear w
by steveklabnik 10y ago
Rust doesn't yet have type level integers, so that'll have to be saved for a future contest. (It's highly desired, and there's an RFC open, but it's not clear when they will land.)
I like this idea though!
- mbrubeck 10y agoBut there are some crates like https://crates.io/crates/typenum https://crates.io/crates/typenum that implement type-level integers on top of the Rust type system, and quite a few other crates that then use these for things like array operations...
- Gankro 10y agoUsing typenum in production isn't a fireable offence?!
- naasking 10y agoNot natively, but you can do it via phantom type parameters. But that does raise an interesting question: could a malicious crate overload a "safe buffer" operation provided by another crate in this way?