Fix compilation on rustc 1.20.0-nightly (067971139 2017-07-02)

This commit is contained in:
messense 2017-07-03 12:26:03 +08:00
parent d9b5f795fa
commit edadbff4ea
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9

View File

@ -13,7 +13,7 @@
extern crate syntax;
use rustc_driver::{driver, CompilerCalls, RustcDefaultCalls, Compilation};
use rustc::session::{config, Session};
use rustc::session::{config, Session, CompileIncomplete};
use rustc::session::config::{Input, ErrorOutputType};
use std::path::PathBuf;
use std::process::{self, Command};
@ -278,10 +278,8 @@ pub fn main() {
let mut ccc = ClippyCompilerCalls::new(clippy_enabled);
let (result, _) = rustc_driver::run_compiler(&args, &mut ccc, None, None);
if let Err(err_count) = result {
if err_count > 0 {
std::process::exit(1);
}
if let Err(CompileIncomplete::Errored(_)) = result {
std::process::exit(1);
}
})
.expect("rustc_thread failed");