Auto merge of #847 - RalfJung:rustup, r=RalfJung

fix for rustc_driver change
This commit is contained in:
bors 2019-07-19 16:04:29 +00:00
commit f9dd11546e
4 changed files with 14 additions and 15 deletions

View File

@ -8,6 +8,7 @@ extern crate test;
use self::miri::eval_main;
use rustc::hir::def_id::LOCAL_CRATE;
use rustc_interface::interface;
use rustc_driver::Compilation;
use crate::test::Bencher;
struct MiriCompilerCalls<'a> {
@ -15,7 +16,7 @@ struct MiriCompilerCalls<'a> {
}
impl rustc_driver::Callbacks for MiriCompilerCalls<'_> {
fn after_analysis(&mut self, compiler: &interface::Compiler) -> bool {
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
compiler.session().abort_if_errors();
compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
@ -31,8 +32,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls<'_> {
compiler.session().abort_if_errors();
// Don't continue execution
false
Compilation::Stop
}
}

View File

@ -1 +1 @@
d36b7f69448f7390fa9dfde75d58b914365acdab
527dce7137f7a3c7bf47d9a503abf25f88ea22de

View File

@ -19,6 +19,7 @@ use rustc_interface::interface;
use rustc::hir::{self, itemlikevisit};
use rustc::ty::TyCtxt;
use rustc::hir::def_id::LOCAL_CRATE;
use rustc_driver::Compilation;
use miri::MiriConfig;
@ -28,18 +29,17 @@ struct MiriCompilerCalls {
}
impl rustc_driver::Callbacks for MiriCompilerCalls {
fn after_parsing(&mut self, compiler: &interface::Compiler) -> bool {
fn after_parsing(&mut self, compiler: &interface::Compiler) -> Compilation {
let attr = (
syntax::symbol::Symbol::intern("miri"),
syntax::feature_gate::AttributeType::Whitelisted,
);
compiler.session().plugin_attributes.borrow_mut().push(attr);
// Continue execution
true
Compilation::Continue
}
fn after_analysis(&mut self, compiler: &interface::Compiler) -> bool {
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
compiler.session().abort_if_errors();
compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
if std::env::args().any(|arg| arg == "--test") {
@ -71,7 +71,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
});
// Continue execution on host target
self.host_target
if self.host_target { Compilation::Continue } else { Compilation::Stop }
}
}

View File

@ -21,24 +21,24 @@ use hex::FromHexError;
use rustc_interface::interface;
use rustc::hir::def_id::LOCAL_CRATE;
use rustc_driver::Compilation;
struct MiriCompilerCalls {
miri_config: miri::MiriConfig,
}
impl rustc_driver::Callbacks for MiriCompilerCalls {
fn after_parsing(&mut self, compiler: &interface::Compiler) -> bool {
fn after_parsing(&mut self, compiler: &interface::Compiler) -> Compilation {
let attr = (
syntax::symbol::Symbol::intern("miri"),
syntax::feature_gate::AttributeType::Whitelisted,
);
compiler.session().plugin_attributes.borrow_mut().push(attr);
// Continue execution
true
Compilation::Continue
}
fn after_analysis(&mut self, compiler: &interface::Compiler) -> bool {
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
init_late_loggers();
compiler.session().abort_if_errors();
@ -54,8 +54,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
compiler.session().abort_if_errors();
// Don't continue execution
false
Compilation::Stop
}
}