Widen the result of widening_mul.#156644
Conversation
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in integer formatting cc @tgross35 |
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@rustbot label +T-libs-api -T-libs r? libs-api |
|
IMO we need generic integers (which lets us have |
|
I suppose we could just let those implementation remain unstable. Or should we outright remove them as well? |
I think we should remove them unless we get a |
|
Yeah, I thought I had replied to this, but apparently not. Definitely, I feel like |
|
r? libs
libs-api already discussed this change, somebody from libs can check it |
|
The review request |
|
r? tgross35 |
|
Actually r? clarfonthey since you've looked at this already, feel free to kick it back if you don't have the time. |
|
Looks good to me. @bors r+ rollup |
…uwer Rollup of 13 pull requests Successful merges: - #156709 (stdarch subtree update) - #155006 (stabilize `feature(cfg_target_has_atomic_equal_alignment)`) - #156444 (Implement `OsStr::split_at`) - #156582 (Allow `global_asm!` in statement positions) - #156661 (Remove `UncheckedIterator`) - #152367 (Derives `Copy` for `ffi::FromBytesUntilNulError`) - #156443 (Fix invalid suggestion for parenthesized break) - #156606 (Add pext/pdep as aliases for extract_bits/deposit_bits) - #156630 (Replace `println!` with `assert!` in HashMap documentation examples) - #156644 (Widen the result of `widening_mul`.) - #156653 (Update `sysinfo` version to `0.39.2`) - #156697 (Add diagnostic items for IoBufReader and StdinLock) - #156704 (reduce usage of `box_patterns` in tests)
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; } ```
Tracking issue: #152016
This PR implements #152016 (comment), which mandates that
widening_mulreturn a single, scalar value rather than a low/high tuple.Consequently, this method is removed from
u128andi128as they are the widest integral types. It has also been removed fromusizeandisizedue to portability concerns.Existing
widening_mulusage has been replaced by equivalent calls tocarrying_mul(which is logically identical to the old behaviour.) Existing – generic – non-doc tests have been removed.Public API