Skip to content

Commit 0021748

Browse files
committed
Remove type aliases from public API
1 parent 776eaa7 commit 0021748

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/lib.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,13 @@
165165
#[doc(hidden)]
166166
pub extern crate core;
167167

168+
use core::cell::UnsafeCell;
168169
use core::marker::PhantomData;
169170
use core::ops::Deref;
170171
use core::ptr;
171-
use core::sync::atomic::{AtomicPtr, Ordering};
172-
173-
// Type alias to sidestep clippy::disallowed_types in downstream projects that
174-
// use Loom.
175-
pub type UnsafeCell<T> = core::cell::UnsafeCell<T>;
176-
177-
// Type alias to sidestep clippy::disallowed_types in downstream projects that
178-
// use Loom.
179172
#[cfg(target_family = "wasm")]
180-
pub type AtomicBool = core::sync::atomic::AtomicBool;
173+
use core::sync::atomic::AtomicBool;
174+
use core::sync::atomic::{AtomicPtr, Ordering};
181175

182176
// Not public API. Used by generated code.
183177
#[doc(hidden)]
@@ -494,11 +488,22 @@ macro_rules! submit {
494488
}
495489

496490
// Not public API.
497-
#[cfg(target_family = "wasm")]
498491
#[doc(hidden)]
499492
pub mod __private {
493+
#[cfg(target_family = "wasm")]
500494
#[doc(hidden)]
501495
pub use rustversion::attr;
496+
497+
// Type alias to sidestep clippy::disallowed_types in downstream projects
498+
// that use Loom.
499+
#[doc(hidden)]
500+
pub type UnsafeCell<T> = core::cell::UnsafeCell<T>;
501+
502+
// Type alias to sidestep clippy::disallowed_types in downstream projects
503+
// that use Loom.
504+
#[cfg(target_family = "wasm")]
505+
#[doc(hidden)]
506+
pub type AtomicBool = core::sync::atomic::AtomicBool;
502507
}
503508

504509
// Not public API.
@@ -510,9 +515,9 @@ macro_rules! __do_submit {
510515
const _: () = {
511516
static __INVENTORY: $crate::Node = $crate::Node {
512517
value: &{ $($value)* },
513-
next: $crate::UnsafeCell::new($crate::core::option::Option::None),
518+
next: $crate::__private::UnsafeCell::new($crate::core::option::Option::None),
514519
#[cfg(target_family = "wasm")]
515-
initialized: $crate::AtomicBool::new(false),
520+
initialized: $crate::__private::AtomicBool::new(false),
516521
};
517522

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

0 commit comments

Comments
 (0)