Files
rust/library/core/src
Jonathan Brouwer 3605c1f769 Rollup merge of #156644 - bjoernager:widening-mul, r=clarfonthey
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 &ndash; generic &ndash; 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;
}
```
2026-05-18 17:07:11 +02:00
..
2026-05-17 15:06:12 +07:00
2026-04-14 18:09:15 -04:00
fix
2025-11-27 17:55:34 +07:00
2026-04-24 18:18:08 +06:00
2026-05-11 10:39:58 +02:00
2026-04-28 16:59:56 -03:00
2026-01-26 17:08:00 +00:00
2026-04-14 18:09:15 -04:00
2025-09-01 21:38:26 -04:00
2026-04-14 18:09:15 -04:00
2026-05-17 15:06:12 +07:00
2026-05-03 12:07:41 -04:00
2025-10-20 12:20:15 -06:00
2026-04-04 19:20:32 +02:00
2026-01-23 15:12:47 +07:00
2026-03-25 11:40:27 +07:00
2025-09-07 21:16:35 -07:00
2025-06-15 22:08:41 +02:00
2026-05-07 21:55:44 +03:00
2026-04-28 12:00:48 +02:00
2025-11-12 14:33:41 +01:00
2026-04-23 19:55:51 -07:00
2026-04-14 18:09:15 -04:00
2026-05-14 06:08:58 +00:00