diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index ed37b48b3e85..3ae8f0f7870c 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -69,8 +69,9 @@ assert_eq!(size_of::>(), size_of::<", s /// Creates a non-zero if the given value is not zero. #[$stability] + #[rustc_const_unstable(feature = "const_nonzero_int_methods", issue = "53718")] #[inline] - pub fn new(n: $Int) -> Option { + pub const fn new(n: $Int) -> Option { if n != 0 { // SAFETY: we just checked that there's no `0` Some(unsafe { Self(n) })