Include suffix on literal tokens
Closed this issue · 0 comments
dtolnay commented
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.
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.