mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
3605c1f769
Widen the result of `widening_mul`. Tracking issue: rust-lang/rust#152016 This PR implements <https://github.com/rust-lang/rust/issues/152016#issuecomment-3843258926>, which mandates that `widening_mul` return a single, scalar value rather than a low/high tuple. Consequently, this method is removed from `u128` and `i128` as they are the widest integral types. It has also been removed from `usize` and `isize` due to portability concerns. Existing `widening_mul` usage has been replaced by equivalent calls to `carrying_mul` (which is logically identical to the old behaviour.) Existing – generic – non-doc tests have been removed. # Public API ```rust impl u8 { pub const fn widening_mul(self, rhs: Self) -> u16; } impl u16 { pub const fn widening_mul(self, rhs: Self) -> u32; } impl u32 { pub const fn widening_mul(self, rhs: Self) -> u64; } impl u64 { pub const fn widening_mul(self, rhs: Self) -> u128; } impl i8 { pub const fn widening_mul(self, rhs: Self) -> i16; } impl i16 { pub const fn widening_mul(self, rhs: Self) -> i32; } impl i32 { pub const fn widening_mul(self, rhs: Self) -> i64; } impl i64 { pub const fn widening_mul(self, rhs: Self) -> i128; } ```