fix miri-rustc-tests
This commit is contained in:
parent
66ca0f2cc2
commit
11d71195dd
1 changed files with 5 additions and 5 deletions
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue