Skip to content

Commit 6dfe144

Browse files
committed
stabilize const_nonzero_int_methods
1 parent c86039b commit 6dfe144

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/libcore/num/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
7979

8080
/// Creates a non-zero if the given value is not zero.
8181
#[$stability]
82-
#[rustc_const_unstable(feature = "const_nonzero_int_methods", issue = "53718")]
82+
#[rustc_const_stable(feature = "const_nonzero_int_methods", since = "1.46.0")]
83+
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
8384
#[inline]
8485
pub const fn new(n: $Int) -> Option<Self> {
8586
if n != 0 {

src/test/ui/consts/const-nonzero.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(const_nonzero_int_methods)]
4-
53
use std::num::NonZeroU8;
64

75
const X: NonZeroU8 = unsafe { NonZeroU8::new_unchecked(5) };

0 commit comments

Comments
 (0)