Skip to content

Commit 7bf55f4

Browse files
committed
use Self alias in place of macros
1 parent a605441 commit 7bf55f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libcore/num/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
6767
)]
6868
#[inline]
6969
pub const unsafe fn new_unchecked(n: $Int) -> Self {
70-
$Ty(n)
70+
Self(n)
7171
}
7272

7373
/// Creates a non-zero if the given value is not zero.
@@ -76,7 +76,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
7676
pub fn new(n: $Int) -> Option<Self> {
7777
if n != 0 {
7878
// SAFETY: we just checked that there's no `0`
79-
Some(unsafe { $Ty(n) })
79+
Some(unsafe { Self(n) })
8080
} else {
8181
None
8282
}

src/libcore/sync/atomic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ let atomic_forty_two = ", stringify!($atomic_type), "::new(42);
12631263
#[$stable]
12641264
#[cfg_attr(not(bootstrap), $const_stable)]
12651265
pub const fn new(v: $int_type) -> Self {
1266-
$atomic_type {v: UnsafeCell::new(v)}
1266+
Self {v: UnsafeCell::new(v)}
12671267
}
12681268
}
12691269

0 commit comments

Comments
 (0)