Skip to content

Commit 219ba5a

Browse files
authored
Merge pull request #88 from ekxide/use-type-alias-for-unsafecell-and-atomic-bool
Use type alias for UnsafeCell and AtomicBool
2 parents 82a2778 + 5177486 commit 219ba5a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@
165165
#[doc(hidden)]
166166
pub extern crate core;
167167

168-
use core::cell::UnsafeCell;
169168
use core::marker::PhantomData;
170169
use core::ops::Deref;
171170
use core::ptr;
172-
#[cfg(target_family = "wasm")]
173-
use core::sync::atomic::AtomicBool;
174171
use core::sync::atomic::{AtomicPtr, Ordering};
175172

173+
pub type UnsafeCell<T> = core::cell::UnsafeCell<T>;
174+
#[cfg(target_family = "wasm")]
175+
pub type AtomicBool = core::sync::atomic::AtomicBool;
176+
176177
// Not public API. Used by generated code.
177178
#[doc(hidden)]
178179
pub struct Registry {
@@ -504,9 +505,9 @@ macro_rules! __do_submit {
504505
const _: () = {
505506
static __INVENTORY: $crate::Node = $crate::Node {
506507
value: &{ $($value)* },
507-
next: $crate::core::cell::UnsafeCell::new($crate::core::option::Option::None),
508+
next: $crate::UnsafeCell::new($crate::core::option::Option::None),
508509
#[cfg(target_family = "wasm")]
509-
initialized: $crate::core::sync::atomic::AtomicBool::new(false),
510+
initialized: $crate::AtomicBool::new(false),
510511
};
511512

512513
#[cfg_attr(any(target_os = "linux", target_os = "android"), link_section = ".text.startup")]

0 commit comments

Comments
 (0)