Skip to content

Commit 21f003a

Browse files
committed
Move compiler input and ouput paths into session
1 parent 42b310f commit 21f003a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/bin/miri.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
5656

5757
fn after_analysis<'tcx>(
5858
&mut self,
59-
compiler: &rustc_interface::interface::Compiler,
59+
_: &rustc_interface::interface::Compiler,
6060
queries: &'tcx rustc_interface::Queries<'tcx>,
6161
) -> Compilation {
62-
compiler.session().abort_if_errors();
63-
6462
queries.global_ctxt().unwrap().enter(|tcx| {
63+
tcx.sess.abort_if_errors();
64+
6565
init_late_loggers(tcx);
6666
if !tcx.sess.crate_types().contains(&CrateType::Executable) {
6767
tcx.sess.fatal("miri only makes sense on bin crates");
@@ -75,7 +75,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
7575
let mut config = self.miri_config.clone();
7676

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

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

92-
compiler.session().abort_if_errors();
93-
9493
Compilation::Stop
9594
}
9695
}

0 commit comments

Comments
 (0)