You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #156644 - bjoernager:widening-mul, r=clarfonthey
Widen the result of `widening_mul`.
Tracking issue: #152016
This PR implements <#152016 (comment)>, 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;
}
```
0 commit comments