remove unnecessary safety conditions related to unchecked uint arithmetic

This commit is contained in:
aisr
2026-04-17 23:44:35 +08:00
parent 4dbafc340b
commit d9c717783e
+3 -3
View File
@@ -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