Closed dtolnay closed 4 years ago
It looks like the integer literals emitted by const_random are plain integers without a type suffix. The below program compiles and prints i32, which is probably not what would be expected.
i32
use const_random::const_random; fn f<T>(_: T) { println!("{}", std::any::type_name::<T>()); } fn main() { f(const_random!(u8)); }
The const_random invocation in this code should expand to 0xNNu8 instead.
0xNNu8
It looks like the integer literals emitted by const_random are plain integers without a type suffix. The below program compiles and prints
i32
, which is probably not what would be expected.The const_random invocation in this code should expand to
0xNNu8
instead.