const_random!(usize) and const_random!(isize) are not currently supported. This is likely because the proc macro runs on the host and may have a different usize size than the target.
One approach that would work for implementing these is to expand to an as cast:
const_random!(usize)
// expands to:
const_random!(u128) as usize
which will truncate high bits and produce a correctly usize-sized random value.
const_random!(usize)
andconst_random!(isize)
are not currently supported. This is likely because the proc macro runs on the host and may have a different usize size than the target.One approach that would work for implementing these is to expand to an
as
cast:which will truncate high bits and produce a correctly usize-sized random value.