about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-02-13 03:53:33 -0500
committerGitHub <noreply@github.com>2025-02-13 03:53:33 -0500
commitf9142b0785a27915d8a085c693542f5922212f4c (patch)
tree8028517c5446d0eefa17f36e2c7255c7392aa2f2
parent36d37966dff8b52653d153d446048c8cb2f84e68 (diff)
parentc91737373a5d24ca930ab0fe478e25c575dcd18e (diff)
downloadrust-f9142b0785a27915d8a085c693542f5922212f4c.tar.gz
rust-f9142b0785a27915d8a085c693542f5922212f4c.zip
Rollup merge of #136949 - ehuss:wasm-bench-time, r=jhpratt
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.
-rw-r--r--library/std/benches/time.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/library/std/benches/time.rs b/library/std/benches/time.rs
index 552481cad92..dfd886738f9 100644
--- a/library/std/benches/time.rs
+++ b/library/std/benches/time.rs
@@ -1,5 +1,3 @@
-use std::time::Instant;
-
 #[cfg(not(target_arch = "wasm32"))]
 use test::{Bencher, black_box};
 
@@ -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));