So I'm playing around with const fns. I want to cast the output of std::mem::size_of::<T>() to 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: Rust Playground
So my question is: is there any way - however hacky and terrible - to cast a usize to a generic integer type T?