Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustup #3419

Merged
merged 19 commits into from
Mar 26, 2024
Merged

Rustup #3419

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a401a45
Print a backtrace in const eval if interrupted
saethlin May 19, 2023
fdbde32
Auto merge of #123041 - RalfJung:miri, r=RalfJung
bors Mar 25, 2024
cfa7239
Auto merge of #123040 - weihanglo:update-cargo, r=weihanglo
bors Mar 25, 2024
b89a223
Rollup merge of #122707 - reedwoodruff:string_docs_typo, r=workingjub…
workingjubilee Mar 25, 2024
c8b99dc
Rollup merge of #122769 - RalfJung:reachable, r=tmiasko
workingjubilee Mar 25, 2024
11d080b
Rollup merge of #122892 - lovesegfault:versioned-vendor, r=onur-ozkan
workingjubilee Mar 25, 2024
3df8339
Rollup merge of #122896 - dpaoliello:stdarch, r=Amanieu
workingjubilee Mar 25, 2024
3e37520
Rollup merge of #122923 - kpreid:print-async-def, r=compiler-errors
workingjubilee Mar 25, 2024
e3fbd8e
Rollup merge of #122950 - ShoyuVanilla:issue-101903, r=compiler-errors
workingjubilee Mar 25, 2024
c4f6c27
Rollup merge of #123039 - rustbot:docs-update, r=ehuss
workingjubilee Mar 25, 2024
b0f1802
Rollup merge of #123042 - dpaoliello:prelude, r=Nilstrieb
workingjubilee Mar 25, 2024
7e24c4a
Rollup merge of #123044 - compiler-errors:instance, r=oli-obk
workingjubilee Mar 25, 2024
332065d
Rollup merge of #123051 - matthiaskrgr:casetest, r=workingjubilee
workingjubilee Mar 25, 2024
a03c064
Auto merge of #111769 - saethlin:ctfe-backtrace-ctrlc, r=RalfJung
bors Mar 26, 2024
467af92
Auto merge of #123065 - workingjubilee:rollup-bve45ex, r=workingjubilee
bors Mar 26, 2024
2b1448a
Auto merge of #122849 - clubby789:no-metadata, r=petrochenkov
bors Mar 26, 2024
32db753
Preparing for merge from rustc
RalfJung Mar 26, 2024
52ff5f0
Merge from rustc
RalfJung Mar 26, 2024
42d68bc
fmt
RalfJung Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cb7c63606e53715f94f3ba04d38e50772e4cd23d
b13a71a2e77f4625d1a2b8a5b9488414686ebca9
4 changes: 4 additions & 0 deletions src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,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
17 changes: 3 additions & 14 deletions src/concurrency/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
use std::cell::RefCell;
use std::collections::hash_map::Entry;
use std::num::TryFromIntError;
use std::sync::atomic::{AtomicBool, Ordering::Relaxed};
use std::sync::atomic::Ordering::Relaxed;
use std::task::Poll;
use std::time::{Duration, SystemTime};

use either::Either;

use rustc_const_eval::CTRL_C_RECEIVED;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def_id::DefId;
use rustc_index::{Idx, IndexVec};
Expand Down Expand Up @@ -1045,21 +1046,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
/// Run the core interpreter loop. Returns only when an interrupt occurs (an error or program
/// termination).
fn run_threads(&mut self) -> InterpResult<'tcx, !> {
static SIGNALED: AtomicBool = AtomicBool::new(false);
ctrlc::set_handler(move || {
// Indicate that we have ben signaled to stop. If we were already signaled, exit
// immediately. In our interpreter loop we try to consult this value often, but if for
// whatever reason we don't get to that check or the cleanup we do upon finding that
// this bool has become true takes a long time, the exit here will promptly exit the
// process on the second Ctrl-C.
if SIGNALED.swap(true, Relaxed) {
std::process::exit(1);
}
})
.unwrap();
let this = self.eval_context_mut();
loop {
if SIGNALED.load(Relaxed) {
if CTRL_C_RECEIVED.load(Relaxed) {
this.machine.handle_abnormal_termination();
std::process::exit(1);
}
Expand Down
Loading