Skip to content

Commit b12d298

Browse files
committed
finish up all features
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent 85de495 commit b12d298

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/task/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ cfg_default! {
151151
mod task;
152152
mod task_id;
153153
mod task_local;
154-
}
155154

156-
#[cfg(any(feature = "unstable", test))]
157-
pub use spawn_blocking::spawn_blocking;
158-
#[cfg(any(feature = "default", test))]
159-
pub(crate) use spawn_blocking::spawn_blocking;
155+
#[cfg(any(feature = "unstable", test))]
156+
pub use spawn_blocking::spawn_blocking;
157+
#[cfg(not(any(feature = "unstable", test)))]
158+
pub(crate) use spawn_blocking::spawn_blocking;
159+
}
160160

161161
cfg_unstable! {
162162
pub use yield_now::yield_now;

src/utils.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
use std::mem;
2-
31
/// Calls a function and aborts if it panics.
42
///
53
/// This is useful in unsafe code where we can't recover from panics.
4+
#[cfg(feature = "default")]
65
#[inline]
76
pub fn abort_on_panic<T>(f: impl FnOnce() -> T) -> T {
87
struct Bomb;
@@ -15,11 +14,12 @@ pub fn abort_on_panic<T>(f: impl FnOnce() -> T) -> T {
1514

1615
let bomb = Bomb;
1716
let t = f();
18-
mem::forget(bomb);
17+
std::mem::forget(bomb);
1918
t
2019
}
2120

2221
/// Generates a random number in `0..n`.
22+
#[cfg(feature = "default")]
2323
pub fn random(n: u32) -> u32 {
2424
use std::cell::Cell;
2525
use std::num::Wrapping;
@@ -47,6 +47,7 @@ pub fn random(n: u32) -> u32 {
4747
}
4848

4949
/// Defers evaluation of a block of code until the end of the scope.
50+
#[cfg(feature = "default")]
5051
#[doc(hidden)]
5152
macro_rules! defer {
5253
($($body:tt)*) => {

0 commit comments

Comments
 (0)