Closed
Description
From @octurion on April 10, 2015 10:12
The trait num::traits::PrimInt
mandates that any type implementing it must also implement Shl<usize, Output=Self>
and Shr<usize, Output=Self>
(in other words, PrimInt
mandates that the shift amount be of type usize
).
Thus all bit twiddling functions (trailing_zeros
, rotate_left
, count_zeros
etc.) in PrimInt
should take or return a usize
instead of u32
as the number of bits for the sake of consistency with what the implementation restrictions on Shl
and Shr
mandate.
Copied from original issue: rust-num/num#80