rust/library/core/src/num
Manish Goregaokar e2301154e3
Rollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcm
`unchecked_{shl|shr}` should use `u32` as the RHS

The other shift methods, such as https://doc.rust-lang.org/nightly/std/primitive.u64.html#method.checked_shr and https://doc.rust-lang.org/nightly/std/primitive.i16.html#method.wrapping_shl, use `u32` for the shift amount.  That's consistent with other things, like `count_ones`, which also always use `u32` for a bit count, regardless of the size of the type.

This PR changes `unchecked_shl` and `unchecked_shr` to also use `u32` for the shift amount (rather than Self).

cc #85122, the `unchecked_math` tracking issue
2022-11-18 17:48:17 -05:00
..
dec2flt more dupe word typos 2022-10-14 12:57:56 +08:00
flt2dec Fix inconsistent rounding of 0.5 when formatted to 0 decimal places 2022-10-11 23:09:23 +02:00
shells
bignum.rs
diy_float.rs
error.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
f32.rs Fix naming format of IEEE 754 standard 2022-09-11 04:13:33 +02:00
f64.rs Fix naming format of IEEE 754 standard 2022-09-11 04:13:33 +02:00
fmt.rs
int_log10.rs more dupe word typos 2022-10-14 12:57:56 +08:00
int_macros.rs Rollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcm 2022-11-18 17:48:17 -05:00
mod.rs unchecked_{shl|shr} should use u32 as the RHS 2022-10-23 17:32:36 -07:00
nonzero.rs remove leading newlines from NonZero* doc examples 2022-11-13 11:32:57 +01:00
saturating.rs
uint_macros.rs Rollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcm 2022-11-18 17:48:17 -05:00
wrapping.rs