Rollup merge of #144682 - nxsaken:strict_overflow_ops, r=Mark-Simulacrum

Stabilize `strict_overflow_ops`

Closes rust-lang/rust#118260
This commit is contained in:
Stuart Cook 2025-08-07 20:49:47 +10:00 committed by GitHub
commit 622b21e80b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 56 additions and 103 deletions

View file

@ -1,6 +1,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![cfg_attr(bootstrap, feature(strict_overflow_ops))]
#![doc(rust_logo)]
#![feature(array_try_map)]
#![feature(assert_matches)]
@ -10,7 +11,6 @@
#![feature(never_type)]
#![feature(rustdoc_internals)]
#![feature(slice_ptr_get)]
#![feature(strict_overflow_ops)]
#![feature(trait_alias)]
#![feature(try_blocks)]
#![feature(unqualified_local_imports)]

View file

@ -469,17 +469,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MAX - 2).strict_add(1), ", stringify!($SelfT), "::MAX - 1);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (", stringify!($SelfT), "::MAX - 2).strict_add(3);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -560,17 +559,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".strict_add_unsigned(2), 3);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (", stringify!($SelfT), "::MAX - 2).strict_add_unsigned(3);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -611,17 +609,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 2).strict_sub(1), ", stringify!($SelfT), "::MIN + 1);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (", stringify!($SelfT), "::MIN + 2).strict_sub(3);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -702,17 +699,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".strict_sub_unsigned(2), -1);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (", stringify!($SelfT), "::MIN + 2).strict_sub_unsigned(3);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -753,17 +749,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.strict_mul(1), ", stringify!($SelfT), "::MAX);")]
/// ```
///
/// The following panics because of overflow:
///
/// ``` should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MAX.strict_mul(2);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -855,24 +850,22 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 1).strict_div(-1), ", stringify!($Max), ");")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.strict_div(-1);")]
/// ```
///
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (1", stringify!($SelfT), ").strict_div(0);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -924,24 +917,22 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 1).strict_div_euclid(-1), ", stringify!($Max), ");")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.strict_div_euclid(-1);")]
/// ```
///
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (1", stringify!($SelfT), ").strict_div_euclid(0);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1092,24 +1083,22 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".strict_rem(2), 1);")]
/// ```
///
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 5", stringify!($SelfT), ".strict_rem(0);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.strict_rem(-1);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1160,24 +1149,22 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".strict_rem_euclid(2), 1);")]
/// ```
///
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 5", stringify!($SelfT), ".strict_rem_euclid(0);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.strict_rem_euclid(-1);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1249,17 +1236,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".strict_neg(), -5);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.strict_neg();")]
///
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1306,17 +1292,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".strict_shl(4), 0x10);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 0x1", stringify!($SelfT), ".strict_shl(129);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1422,17 +1407,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".strict_shr(4), 0x1);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 0x10", stringify!($SelfT), ".strict_shr(128);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1542,17 +1526,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!((-5", stringify!($SelfT), ").strict_abs(), 5);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.strict_abs();")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1612,17 +1595,16 @@ macro_rules! int_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(8", stringify!($SelfT), ".strict_pow(2), 64);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MAX.strict_pow(2);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]

View file

@ -538,17 +538,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MAX - 2).strict_add(1), ", stringify!($SelfT), "::MAX - 1);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (", stringify!($SelfT), "::MAX - 2).strict_add(3);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -630,22 +629,20 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".strict_add_signed(2), 3);")]
/// ```
///
/// The following panic because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 1", stringify!($SelfT), ".strict_add_signed(-2);")]
/// ```
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (", stringify!($SelfT), "::MAX - 2).strict_add_signed(3);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -695,17 +692,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".strict_sub(1), 0);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 0", stringify!($SelfT), ".strict_sub(1);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -817,22 +813,20 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(3", stringify!($SelfT), ".strict_sub_signed(2), 1);")]
/// ```
///
/// The following panic because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 1", stringify!($SelfT), ".strict_sub_signed(2);")]
/// ```
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (", stringify!($SelfT), "::MAX).strict_sub_signed(-1);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -932,17 +926,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".strict_mul(1), 5);")]
/// ```
///
/// The following panics because of overflow:
///
/// ``` should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MAX.strict_mul(2);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1029,17 +1022,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".strict_div(10), 10);")]
/// ```
///
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (1", stringify!($SelfT), ").strict_div(0);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
@ -1085,16 +1077,15 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".strict_div_euclid(10), 10);")]
/// ```
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = (1", stringify!($SelfT), ").strict_div_euclid(0);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
@ -1239,17 +1230,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".strict_rem(10), 0);")]
/// ```
///
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 5", stringify!($SelfT), ".strict_rem(0);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
@ -1296,17 +1286,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".strict_rem_euclid(10), 0);")]
/// ```
///
/// The following panics because of division by zero:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 5", stringify!($SelfT), ".strict_rem_euclid(0);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
@ -1568,17 +1557,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(0", stringify!($SelfT), ".strict_neg(), 0);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 1", stringify!($SelfT), ".strict_neg();")]
///
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1625,17 +1613,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".strict_shl(4), 0x10);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 0x10", stringify!($SelfT), ".strict_shl(129);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1741,17 +1728,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".strict_shr(4), 0x1);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = 0x10", stringify!($SelfT), ".strict_shr(129);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1867,17 +1853,16 @@ macro_rules! uint_impl {
/// # Examples
///
/// ```
/// #![feature(strict_overflow_ops)]
#[doc = concat!("assert_eq!(2", stringify!($SelfT), ".strict_pow(5), 32);")]
/// ```
///
/// The following panics because of overflow:
///
/// ```should_panic
/// #![feature(strict_overflow_ops)]
#[doc = concat!("let _ = ", stringify!($SelfT), "::MAX.strict_pow(2);")]
/// ```
#[unstable(feature = "strict_overflow_ops", issue = "118260")]
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]

View file

@ -1,3 +1,4 @@
#![cfg_attr(bootstrap, feature(strict_overflow_ops))]
#![feature(abort_unwind)]
#![feature(cfg_select)]
#![feature(rustc_private)]
@ -11,7 +12,6 @@
#![feature(variant_count)]
#![feature(yeet_expr)]
#![feature(nonzero_ops)]
#![feature(strict_overflow_ops)]
#![feature(pointer_is_aligned_to)]
#![feature(ptr_metadata)]
#![feature(unqualified_local_imports)]

View file

@ -10699,20 +10699,6 @@ The tracking issue for this feature is: [#77998]
[#77998]: https://github.com/rust-lang/rust/issues/77998
------------------------
"##,
default_severity: Severity::Allow,
warn_since: None,
deny_since: None,
},
Lint {
label: "strict_overflow_ops",
description: r##"# `strict_overflow_ops`
The tracking issue for this feature is: [#118260]
[#118260]: https://github.com/rust-lang/rust/issues/118260
------------------------
"##,
default_severity: Severity::Allow,