Skip to content

Commit f66e3bb

Browse files
committed
Auto merge of #154825 - Lars-Schumann:non-zero-const-step, r=<try>
constify `Step for NonZero<u*>` try-job: i686-msvc-2
2 parents 49b6ac0 + 256f036 commit f66e3bb

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

library/core/src/iter/range.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ macro_rules! step_nonzero_impls {
513513
$(
514514
#[allow(unreachable_patterns)]
515515
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
516-
impl Step for NonZero<$narrower> {
516+
#[rustc_const_unstable(feature = "step_trait", issue = "42168")]
517+
impl const Step for NonZero<$narrower> {
517518
step_nonzero_identical_methods!($narrower);
518519

519520
#[inline]
@@ -538,7 +539,8 @@ macro_rules! step_nonzero_impls {
538539
$(
539540
#[allow(unreachable_patterns)]
540541
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
541-
impl Step for NonZero<$wider> {
542+
#[rustc_const_unstable(feature = "step_trait", issue = "42168")]
543+
impl const Step for NonZero<$wider> {
542544
step_nonzero_identical_methods!($wider);
543545

544546
#[inline]

library/core/src/num/nonzero.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ impl_nonzero_auto_trait!(Unpin);
184184
impl_nonzero_auto_trait!(UnwindSafe);
185185

186186
#[stable(feature = "nonzero", since = "1.28.0")]
187-
impl<T> Clone for NonZero<T>
187+
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
188+
impl<T> const Clone for NonZero<T>
188189
where
189190
T: ZeroablePrimitive,
190191
{
@@ -202,7 +203,8 @@ impl<T> Copy for NonZero<T> where T: ZeroablePrimitive {}
202203

203204
#[doc(hidden)]
204205
#[unstable(feature = "trivial_clone", issue = "none")]
205-
unsafe impl<T> TrivialClone for NonZero<T> where T: ZeroablePrimitive {}
206+
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
207+
unsafe impl<T> const TrivialClone for NonZero<T> where T: ZeroablePrimitive {}
206208

207209
#[stable(feature = "nonzero", since = "1.28.0")]
208210
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]

0 commit comments

Comments
 (0)