Skip to content

Bump Rust #1086

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@
809e180a76ce97340bf4354ff357bc59e3ca40b2
8f1bbd69e13c9e04a4c2b75612bc0c31af972439
19 changes: 10 additions & 9 deletions src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,21 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
init_late_loggers();
compiler.session().abort_if_errors();

compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect("no main function found!");
let mut config = self.miri_config.clone();
compiler.enter(|queries| {
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ICEs. I am not entirely sure why. See rust-lang/rust#66791 (comment).

let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect("no main function found!");
let mut config = self.miri_config.clone();

// Add filename to `miri` arguments.
config.args.insert(0, compiler.input().filestem().to_string());
// Add filename to `miri` arguments.
config.args.insert(0, compiler.input().filestem().to_string());

if let Some(return_code) = miri::eval_main(tcx, entry_def_id, config) {
std::process::exit(i32::try_from(return_code).expect("Return value was too large!"));
}
if let Some(return_code) = miri::eval_main(tcx, entry_def_id, config) {
std::process::exit(i32::try_from(return_code).expect("Return value was too large!"));
}
})
});

compiler.session().abort_if_errors();

Compilation::Stop
}
}
Expand Down