but this leads to an error if the random number is negative.
error: literal out of range for i32
--> src/main.rs:14:13
|
14 | const RAND: i32 = const_random!(i32);
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(overflowing_literals)]` on by default
= note: the literal `0xda324e7e` (decimal `3660729982`) does not fit into the type `i32` and will become `-634237314i32`
= help: consider using `u32` instead
const-random currently emits signed integers in lowercase hex representation:
https://github.com/tkaitchuck/constrandom/blob/3425388e7fd027c21e3ac7fcffc8c1ea3e9b0e32/macro/src/lib.rs#L28
but this leads to an error if the random number is negative.
Deterministic repro: