mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
remove unnecessary safety conditions related to unchecked uint arithmetic
This commit is contained in:
@@ -866,7 +866,7 @@ pub const fn strict_add(self, rhs: Self) -> Self {
|
||||
/// # Safety
|
||||
///
|
||||
/// This results in undefined behavior when
|
||||
#[doc = concat!("`self + rhs > ", stringify!($SelfT), "::MAX` or `self + rhs < ", stringify!($SelfT), "::MIN`,")]
|
||||
#[doc = concat!("`self + rhs > ", stringify!($SelfT), "::MAX`,")]
|
||||
/// i.e. when [`checked_add`] would return `None`.
|
||||
///
|
||||
/// [`unwrap_unchecked`]: option/enum.Option.html#method.unwrap_unchecked
|
||||
@@ -1045,7 +1045,7 @@ pub const fn strict_sub(self, rhs: Self) -> Self {
|
||||
/// # Safety
|
||||
///
|
||||
/// This results in undefined behavior when
|
||||
#[doc = concat!("`self - rhs > ", stringify!($SelfT), "::MAX` or `self - rhs < ", stringify!($SelfT), "::MIN`,")]
|
||||
#[doc = concat!("`self - rhs < ", stringify!($SelfT), "::MIN`,")]
|
||||
/// i.e. when [`checked_sub`] would return `None`.
|
||||
///
|
||||
/// [`unwrap_unchecked`]: option/enum.Option.html#method.unwrap_unchecked
|
||||
@@ -1254,7 +1254,7 @@ pub const fn strict_mul(self, rhs: Self) -> Self {
|
||||
/// # Safety
|
||||
///
|
||||
/// This results in undefined behavior when
|
||||
#[doc = concat!("`self * rhs > ", stringify!($SelfT), "::MAX` or `self * rhs < ", stringify!($SelfT), "::MIN`,")]
|
||||
#[doc = concat!("`self * rhs > ", stringify!($SelfT), "::MAX`,")]
|
||||
/// i.e. when [`checked_mul`] would return `None`.
|
||||
///
|
||||
/// [`unwrap_unchecked`]: option/enum.Option.html#method.unwrap_unchecked
|
||||
|
||||
Reference in New Issue
Block a user