diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2024-12-11 18:00:56 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2025-03-06 17:58:32 -0300 |
| commit | dcdfd551f05073ececfa437be002ce7804b31c91 (patch) | |
| tree | 813604b622c9bb09c15e1724a6cebfd9d340b53d /library/core/src/num | |
| parent | 57cb498989ac29fbe9938ed2f4a31a3eab6850dc (diff) | |
| download | rust-dcdfd551f05073ececfa437be002ce7804b31c91.tar.gz rust-dcdfd551f05073ececfa437be002ce7804b31c91.zip | |
Add UseCloned trait related code
Diffstat (limited to 'library/core/src/num')
| -rw-r--r-- | library/core/src/num/bignum.rs | 2 | ||||
| -rw-r--r-- | library/core/src/num/nonzero.rs | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/library/core/src/num/bignum.rs b/library/core/src/num/bignum.rs index 2a47c89e2ae..9de6b349d94 100644 --- a/library/core/src/num/bignum.rs +++ b/library/core/src/num/bignum.rs @@ -405,6 +405,8 @@ macro_rules! define_bignum { } } + impl crate::clone::UseCloned for $name {} + impl crate::fmt::Debug for $name { fn fmt(&self, f: &mut crate::fmt::Formatter<'_>) -> crate::fmt::Result { let sz = if self.size < 1 { 1 } else { self.size }; diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index a967b72c4fa..5b997d44278 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -1,6 +1,7 @@ //! Definitions of integer that is known not to equal zero. use super::{IntErrorKind, ParseIntError}; +use crate::clone::UseCloned; use crate::cmp::Ordering; use crate::hash::{Hash, Hasher}; use crate::marker::{Freeze, StructuralPartialEq}; @@ -183,6 +184,9 @@ where } } +#[unstable(feature = "ergonomic_clones", issue = "132290")] +impl<T> UseCloned for NonZero<T> where T: ZeroablePrimitive {} + #[stable(feature = "nonzero", since = "1.28.0")] impl<T> Copy for NonZero<T> where T: ZeroablePrimitive {} |
