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-04-22 20:30:52 +08:00
2026-05-13 19:53:10 +02:00
2026-05-08 16:30:52 +08:00

This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.

Why Rust?

  • Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages.

  • Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.

  • Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).

Quick Start

Read "Installation" from The Book.

Installing from Source

If you really want to install from source (though this is not recommended), see INSTALL.md.

Getting Help

See https://www.rust-lang.org/community for a list of chat platforms and forums.

Contributing

See CONTRIBUTING.md.

For a detailed explanation of the compiler's architecture and how to begin contributing, see the rustc-dev-guide.

License

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

Trademark

The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").

If you want to use these names or brands, please read the Rust language trademark policy.

Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.

S
Description
Это основной репозиторий исходного кода Rust . Он содержит компилятор, стандартную библиотеку и документацию.
Readme 1.7 GiB
Languages
Rust 95.7%
Shell 1%
C 0.9%
JavaScript 0.6%
Python 0.4%
Other 1.1%