Skip to content

Commit

Permalink
stabilize const_nonzero_int_methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tspiteri committed Jun 29, 2020
1 parent c86039b commit 6dfe144
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/libcore/num/mod.rs
Expand Up @@ -79,7 +79,8 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), 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")]
#[rustc_const_stable(feature = "const_nonzero_int_methods", since = "1.46.0")]
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
#[inline]
pub const fn new(n: $Int) -> Option<Self> {
if n != 0 {
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/consts/const-nonzero.rs
@@ -1,7 +1,5 @@
// run-pass

#![feature(const_nonzero_int_methods)]

use std::num::NonZeroU8;

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

0 comments on commit 6dfe144

Please sign in to comment.