Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Mar 10, 2024
1 parent 9fd99a7 commit fb3f984
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ pub fn init_logger(early_dcx: &EarlyDiagCtxt, cfg: rustc_log::LoggerConfig) {
}

/// Install our usual `ctrlc` handler, which sets [`rustc_const_eval::CTRL_C_RECEIVED`].
/// Makign this handler optional lets tools can install a different handler, if they wish.
/// Making this handler optional lets tools can install a different handler, if they wish.
pub fn install_ctrlc_handler() {
ctrlc::set_handler(move || {
// Indicate that we have been signaled to stop. If we were already signaled, exit
Expand Down
7 changes: 4 additions & 3 deletions src/tools/miri/src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ fn main() {
let args = rustc_driver::args::raw_args(&early_dcx)
.unwrap_or_else(|_| std::process::exit(rustc_driver::EXIT_FAILURE));

// Install the ctrlc handler that sets `rustc_const_eval::CTRL_C_RECEIVED`, even if
// MIRI_BE_RUSTC is set.
rustc_driver::install_ctrlc_handler();

// If the environment asks us to actually be rustc, then do that.
if let Some(crate_kind) = env::var_os("MIRI_BE_RUSTC") {
// Earliest rustc setup.
Expand Down Expand Up @@ -372,9 +376,6 @@ fn main() {
let using_internal_features =
rustc_driver::install_ice_hook("https://github.com/rust-lang/miri/issues/new", |_| ());

// Install the ctrlc handler that sets `rustc_const_eval::CTRL_C_RECEIVED`.
rustc_driver::install_ctrlc_handler();

// Init loggers the Miri way.
init_early_loggers(&early_dcx);

Expand Down

0 comments on commit fb3f984

Please sign in to comment.