File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -151,12 +151,12 @@ cfg_default! {
151
151
mod task;
152
152
mod task_id;
153
153
mod task_local;
154
- }
155
154
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
+ }
160
160
161
161
cfg_unstable ! {
162
162
pub use yield_now:: yield_now;
Original file line number Diff line number Diff line change 1
- use std:: mem;
2
-
3
1
/// Calls a function and aborts if it panics.
4
2
///
5
3
/// This is useful in unsafe code where we can't recover from panics.
4
+ #[ cfg( feature = "default" ) ]
6
5
#[ inline]
7
6
pub fn abort_on_panic < T > ( f : impl FnOnce ( ) -> T ) -> T {
8
7
struct Bomb ;
@@ -15,11 +14,12 @@ pub fn abort_on_panic<T>(f: impl FnOnce() -> T) -> T {
15
14
16
15
let bomb = Bomb ;
17
16
let t = f ( ) ;
18
- mem:: forget ( bomb) ;
17
+ std :: mem:: forget ( bomb) ;
19
18
t
20
19
}
21
20
22
21
/// Generates a random number in `0..n`.
22
+ #[ cfg( feature = "default" ) ]
23
23
pub fn random ( n : u32 ) -> u32 {
24
24
use std:: cell:: Cell ;
25
25
use std:: num:: Wrapping ;
@@ -47,6 +47,7 @@ pub fn random(n: u32) -> u32 {
47
47
}
48
48
49
49
/// Defers evaluation of a block of code until the end of the scope.
50
+ #[ cfg( feature = "default" ) ]
50
51
#[ doc( hidden) ]
51
52
macro_rules! defer {
52
53
( $( $body: tt) * ) => {
You can’t perform that action at this time.
0 commit comments