Skip to content

Commit

Permalink
Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petroche…
Browse files Browse the repository at this point in the history
…nkov

Various cleanups around pre-TyCtxt queries and functions

part of #105462

based on rust-lang/rust#106776 (everything starting at [0e2b39f](rust-lang/rust@0e2b39f) is new in this PR)

r? `@petrochenkov`

I think this should be most of the uncontroversial part of #105462.
  • Loading branch information
bors committed Jan 19, 2023
2 parents d92bae1 + 21f003a commit eae3094
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {

fn after_analysis<'tcx>(
&mut self,
compiler: &rustc_interface::interface::Compiler,
_: &rustc_interface::interface::Compiler,
queries: &'tcx rustc_interface::Queries<'tcx>,
) -> Compilation {
compiler.session().abort_if_errors();

queries.global_ctxt().unwrap().enter(|tcx| {
tcx.sess.abort_if_errors();

init_late_loggers(tcx);
if !tcx.sess.crate_types().contains(&CrateType::Executable) {
tcx.sess.fatal("miri only makes sense on bin crates");
Expand All @@ -75,7 +75,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
let mut config = self.miri_config.clone();

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

// Adjust working directory for interpretation.
if let Some(cwd) = env::var_os("MIRI_CWD") {
Expand All @@ -87,10 +87,9 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
i32::try_from(return_code).expect("Return value was too large!"),
);
}
tcx.sess.abort_if_errors();
});

compiler.session().abort_if_errors();

Compilation::Stop
}
}
Expand Down

0 comments on commit eae3094

Please sign in to comment.