Skip to content

Commit

Permalink
Rollup merge of #136949 - ehuss:wasm-bench-time, r=jhpratt
Browse files Browse the repository at this point in the history
Fix import in bench for wasm

This import was causing annoying unused import errors when checking the standard library for some wasm targets. The problem is that everything here is disabled if it is wasm32, but this import wasn't cfg'd.
  • Loading branch information
jhpratt authored Feb 13, 2025
2 parents e8094a5 + c917373 commit 374fee3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/std/benches/time.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::time::Instant;

#[cfg(not(target_arch = "wasm32"))]
use test::{Bencher, black_box};

Expand All @@ -10,6 +8,7 @@ macro_rules! bench_instant_threaded {
fn $bench_name(b: &mut Bencher) -> std::thread::Result<()> {
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::Instant;

let running = Arc::new(AtomicBool::new(true));

Expand Down

0 comments on commit 374fee3

Please sign in to comment.