|
67 | 67 | //!
|
68 | 68 | //! [`portable-atomic`]: https://crates.io/crates/portable-atomic
|
69 | 69 |
|
70 |
| -#![cfg_attr(all(not(feature = "std"), not(test)), no_std)] |
| 70 | +#![cfg_attr(not(feature = "std"), no_std)] |
71 | 71 | #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
|
72 | 72 | #![doc(
|
73 | 73 | html_favicon_url = "https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"
|
|
76 | 76 | html_logo_url = "https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"
|
77 | 77 | )]
|
78 | 78 |
|
| 79 | +#[cfg(not(feature = "std"))] |
79 | 80 | extern crate alloc;
|
| 81 | +#[cfg(feature = "std")] |
| 82 | +extern crate std as alloc; |
80 | 83 |
|
81 | 84 | #[cfg_attr(feature = "std", path = "std.rs")]
|
82 | 85 | #[cfg_attr(not(feature = "std"), path = "no_std.rs")]
|
83 | 86 | mod sys;
|
84 | 87 |
|
85 | 88 | mod notify;
|
86 | 89 |
|
| 90 | +#[cfg(not(feature = "std"))] |
87 | 91 | use alloc::boxed::Box;
|
88 | 92 |
|
89 | 93 | use core::borrow::Borrow;
|
@@ -1365,6 +1369,9 @@ fn __test_send_and_sync() {
|
1365 | 1369 | fn _assert_sync<T: Sync>() {}
|
1366 | 1370 |
|
1367 | 1371 | _assert_send::<crate::__private::StackSlot<'_, ()>>();
|
| 1372 | + _assert_sync::<crate::__private::StackSlot<'_, ()>>(); |
| 1373 | + _assert_send::<crate::__private::StackListener<'_, '_, ()>>(); |
| 1374 | + _assert_sync::<crate::__private::StackListener<'_, '_, ()>>(); |
1368 | 1375 | _assert_send::<Event<()>>();
|
1369 | 1376 | _assert_sync::<Event<()>>();
|
1370 | 1377 | _assert_send::<EventListener<()>>();
|
@@ -1410,6 +1417,7 @@ pub mod __private {
|
1410 | 1417 | impl<T> core::panic::UnwindSafe for StackSlot<'_, T> {}
|
1411 | 1418 | impl<T> core::panic::RefUnwindSafe for StackSlot<'_, T> {}
|
1412 | 1419 | unsafe impl<T> Send for StackSlot<'_, T> {}
|
| 1420 | + unsafe impl<T> Sync for StackSlot<'_, T> {} |
1413 | 1421 |
|
1414 | 1422 | impl<'ev, T> StackSlot<'ev, T> {
|
1415 | 1423 | /// Create a new `StackSlot` on the stack.
|
|
0 commit comments