diff --git a/src/Cargo.lock b/src/Cargo.lock index 7d495a8041dd7..9d5f3bbd9e367 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -222,18 +222,6 @@ dependencies = [ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "cargo_metadata" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cargo_metadata" version = "0.6.0" @@ -307,7 +295,7 @@ name = "clippy" version = "0.0.212" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "clippy-mini-macro-test 0.2.0", "clippy_lints 0.0.212", "compiletest_rs 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -329,7 +317,7 @@ version = "0.2.0" name = "clippy_lints" version = "0.0.212" dependencies = [ - "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3071,7 +3059,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" "checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" -"checksum cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1efca0b863ca03ed4c109fb1c55e0bc4bbeb221d3e103d86251046b06a526bd0" "checksum cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6809b327f87369e6f3651efd2c5a96c49847a3ed2559477ecba79014751ee1" "checksum cc 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "4a6007c146fdd28d4512a794b07ffe9d8e89e6bf86e2e0c4ddff2e1fb54a0007" "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index f88c619bf7791..a96c277d4b555 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -185,27 +185,29 @@ pub fn run(run_compiler: F) -> isize where F: FnOnce() -> (CompileResult, Option) + Send + 'static { let result = monitor(move || { - let (result, session) = run_compiler(); - if let Err(CompileIncomplete::Errored(_)) = result { - match session { - Some(sess) => { - sess.abort_if_errors(); - panic!("error reported but abort_if_errors didn't abort???"); - } - None => { - let emitter = - errors::emitter::EmitterWriter::stderr(errors::ColorConfig::Auto, - None, - true, - false); - let handler = errors::Handler::with_emitter(true, false, Box::new(emitter)); - handler.emit(&MultiSpan::new(), - "aborting due to previous error(s)", - errors::Level::Fatal); - panic::resume_unwind(Box::new(errors::FatalErrorMarker)); + syntax::with_globals(|| { + let (result, session) = run_compiler(); + if let Err(CompileIncomplete::Errored(_)) = result { + match session { + Some(sess) => { + sess.abort_if_errors(); + panic!("error reported but abort_if_errors didn't abort???"); + } + None => { + let emitter = + errors::emitter::EmitterWriter::stderr(errors::ColorConfig::Auto, + None, + true, + false); + let handler = errors::Handler::with_emitter(true, false, Box::new(emitter)); + handler.emit(&MultiSpan::new(), + "aborting due to previous error(s)", + errors::Level::Fatal); + panic::resume_unwind(Box::new(errors::FatalErrorMarker)); + } } } - } + }); }); match result { @@ -471,17 +473,15 @@ pub fn run_compiler<'a>(args: &[String], emitter_dest: Option>) -> (CompileResult, Option) { - syntax::with_globals(|| { - let matches = match handle_options(args) { - Some(matches) => matches, - None => return (Ok(()), None), - }; + let matches = match handle_options(args) { + Some(matches) => matches, + None => return (Ok(()), None), + }; - let (sopts, cfg) = config::build_session_options_and_crate_config(&matches); + let (sopts, cfg) = config::build_session_options_and_crate_config(&matches); - driver::spawn_thread_pool(sopts, |sopts| { - run_compiler_with_pool(matches, sopts, cfg, callbacks, file_loader, emitter_dest) - }) + driver::spawn_thread_pool(sopts, |sopts| { + run_compiler_with_pool(matches, sopts, cfg, callbacks, file_loader, emitter_dest) }) } diff --git a/src/test/run-pass-fulldeps/compiler-calls.rs b/src/test/run-pass-fulldeps/compiler-calls.rs index baf9e0d5dc5a6..6283d054373c1 100644 --- a/src/test/run-pass-fulldeps/compiler-calls.rs +++ b/src/test/run-pass-fulldeps/compiler-calls.rs @@ -92,7 +92,9 @@ fn main() { let tc = TestCalls { count: &mut count }; // we should never get use this filename, but lets make sure they are valid args. let args = vec!["compiler-calls".to_string(), "foo.rs".to_string()]; - rustc_driver::run_compiler(&args, Box::new(tc), None, None); + syntax::with_globals(|| { + rustc_driver::run_compiler(&args, Box::new(tc), None, None); + }); } assert_eq!(count, 30); } diff --git a/src/tools/clippy b/src/tools/clippy index dda656652e2e1..628934424e9c1 160000 --- a/src/tools/clippy +++ b/src/tools/clippy @@ -1 +1 @@ -Subproject commit dda656652e2e1a8d615a712d7f7482c25fa0a9c2 +Subproject commit 628934424e9c181a4162b3a5d01e4211ee98b7b7