Skip to content

Commit bf1f5c9

Browse files
committed
Avoid unused import warning for the Ctrl-C handler on wasm
1 parent 68034f8 commit bf1f5c9

File tree

1 file changed

+3
-4
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+3
-4
lines changed

compiler/rustc_driver_impl/src/lib.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ use std::path::PathBuf;
2929
use std::process::{self, Command, Stdio};
3030
use std::sync::atomic::{AtomicBool, Ordering};
3131
use std::sync::{Arc, OnceLock};
32-
use std::time::{Duration, Instant, SystemTime};
32+
use std::time::{Instant, SystemTime};
3333
use std::{env, str};
3434

3535
use rustc_ast as ast;
3636
use rustc_codegen_ssa::traits::CodegenBackend;
3737
use rustc_codegen_ssa::{CodegenErrors, CodegenResults};
38-
use rustc_const_eval::CTRL_C_RECEIVED;
3938
use rustc_data_structures::profiling::{
4039
TimePassesFormat, get_resident_set_size, print_time_passes_entry,
4140
};
@@ -1577,8 +1576,8 @@ pub fn install_ctrlc_handler() {
15771576
// time to check CTRL_C_RECEIVED and run its own shutdown logic, but after a short amount
15781577
// of time exit the process. This sleep+exit ensures that even if nobody is checking
15791578
// CTRL_C_RECEIVED, the compiler exits reasonably promptly.
1580-
CTRL_C_RECEIVED.store(true, Ordering::Relaxed);
1581-
std::thread::sleep(Duration::from_millis(100));
1579+
rustc_const_eval::CTRL_C_RECEIVED.store(true, Ordering::Relaxed);
1580+
std::thread::sleep(std::time::Duration::from_millis(100));
15821581
std::process::exit(1);
15831582
})
15841583
.expect("Unable to install ctrlc handler");

0 commit comments

Comments
 (0)