Closed
Description
I would find it incredibly useful to being able to cast a bool to another type so I can shift it around to generate bitmasks but ALAS this is not possible at the moment due to missing From trait impls:
error[E0277]: the trait bound `u32: core::convert::From<bool>` is not satisfied
Using as
instead works fine but is frowned upon by clippy if the type is not a bool but a different type instead:
warning: casting u16 to u32 may become silently lossy if types change
Since the code in question is automatically generated it would be great if there was one common implementation that can (and should) be used for all types.