Skip to content

Commit dbd815a

Browse files
authored
Remove implementation of Random for NonZero<T>
1 parent 77de8b2 commit dbd815a

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

library/core/src/num/nonzero.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::hash::{Hash, Hasher};
66
use crate::marker::{Freeze, StructuralPartialEq};
77
use crate::ops::{BitOr, BitOrAssign, Div, DivAssign, Neg, Rem, RemAssign};
88
use crate::panic::{RefUnwindSafe, UnwindSafe};
9-
use crate::random::{Random, RandomSource};
109
use crate::str::FromStr;
1110
use crate::{fmt, intrinsics, ptr, ub_checks};
1211

@@ -361,17 +360,6 @@ where
361360
}
362361
}
363362

364-
#[unstable(feature = "random", issue = "130703")]
365-
impl<T: ZeroablePrimitive + Random> Random for NonZero<T> {
366-
fn random(source: &mut (impl RandomSource + ?Sized)) -> Self {
367-
loop {
368-
if let Some(n) = Self::new(T::random(source)) {
369-
break n;
370-
}
371-
}
372-
}
373-
}
374-
375363
impl<T> NonZero<T>
376364
where
377365
T: ZeroablePrimitive,

0 commit comments

Comments
 (0)