File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ impl Default for TimerHandle {
277
277
// handle which will return errors when timer objects are attempted to
278
278
// be associated.
279
279
if fallback == 0 {
280
- #[ cfg( not( feature = "wasm-bindgen " ) ) ]
280
+ #[ cfg( not( target_arch = "wasm32 " ) ) ]
281
281
{
282
282
let helper = match crate :: global_native:: HelperThread :: new ( ) {
283
283
Ok ( helper) => helper,
@@ -298,7 +298,7 @@ impl Default for TimerHandle {
298
298
}
299
299
}
300
300
301
- #[ cfg( feature = "wasm-bindgen" ) ]
301
+ #[ cfg( all ( feature = "wasm-bindgen" , target_arch = "wasm32" ) ) ]
302
302
{
303
303
let handle = crate :: global_wasm:: run ( ) ;
304
304
@@ -307,6 +307,8 @@ impl Default for TimerHandle {
307
307
return handle;
308
308
}
309
309
}
310
+ #[ cfg( all( not( feature = "wasm-bindgen" ) , target_arch = "wasm32" ) ) ]
311
+ compile_error ! ( "The `wasm-bindgen` feature must be used when compiling to wasm." ) ;
310
312
311
313
fallback = HANDLE_FALLBACK . load ( SeqCst ) ;
312
314
}
You can’t perform that action at this time.
0 commit comments