So I’m playing around with const fns. I want to cast the output of
T for all int types. In a non-const fn, I can define a casting trait and implement it for each int type (or better yet, use the
num crate) - but I can’t do this in a const context.
Here’s a playground example of what I mean: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=c7ac7c2238ce17fd978f3f12aa3d9452
So my question is: is there any way - however hacky and terrible - to cast a
usize to a generic integer type T?