From 3596d4498808d44e0923a547fe2f1ec7774fffb9 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Sat, 16 Dec 2023 14:12:50 +0100 Subject: Merge commit 'a859e5cc1ce100df22346a1005da30532d04de59' into clippyup --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index bbf7d22c850..dffa854177b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,7 +105,7 @@ impl ClippyCmd { } fn into_std_cmd(self) -> Command { - let mut cmd = Command::new("cargo"); + let mut cmd = Command::new(env::var("CARGO").unwrap_or("cargo".into())); let clippy_args: String = self .clippy_args .iter() -- cgit 1.4.1-3-g733a5 From 42729d6b9ad2ddf5deb70b4a8a855f047de5aed4 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Sun, 17 Dec 2023 22:01:06 +1100 Subject: Rename `EarlyErrorHandler` as `EarlyDiagCtxt`. --- src/driver.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/driver.rs b/src/driver.rs index 49f0cad08e0..af38dde254e 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -18,7 +18,7 @@ extern crate rustc_span; use rustc_interface::interface; use rustc_session::config::ErrorOutputType; use rustc_session::parse::ParseSess; -use rustc_session::EarlyErrorHandler; +use rustc_session::EarlyDiagCtxt; use rustc_span::symbol::Symbol; use std::env; @@ -174,7 +174,7 @@ const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rust-clippy/issues/ne #[allow(clippy::too_many_lines)] #[allow(clippy::ignored_unit_patterns)] pub fn main() { - let handler = EarlyErrorHandler::new(ErrorOutputType::default()); + let handler = EarlyDiagCtxt::new(ErrorOutputType::default()); rustc_driver::init_rustc_env_logger(&handler); -- cgit 1.4.1-3-g733a5 From d165a38de033c54e27ab89faca97cbab24d5e6f5 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 18 Dec 2023 11:15:13 +1100 Subject: Rename many `DiagCtxt` and `EarlyDiagCtxt` locals. --- clippy_lints/src/doc/needless_doctest_main.rs | 4 ++-- src/driver.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/clippy_lints/src/doc/needless_doctest_main.rs b/clippy_lints/src/doc/needless_doctest_main.rs index b2ac39a8e9f..c639813a3f9 100644 --- a/clippy_lints/src/doc/needless_doctest_main.rs +++ b/clippy_lints/src/doc/needless_doctest_main.rs @@ -45,10 +45,10 @@ pub fn check( let fallback_bundle = rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false); let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle); - let handler = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings(); + let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings(); #[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_dcx let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); - let sess = ParseSess::with_dcx(handler, sm); + let sess = ParseSess::with_dcx(dcx, sm); let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) { Ok(p) => p, diff --git a/src/driver.rs b/src/driver.rs index af38dde254e..b944a299256 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -174,9 +174,9 @@ const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rust-clippy/issues/ne #[allow(clippy::too_many_lines)] #[allow(clippy::ignored_unit_patterns)] pub fn main() { - let handler = EarlyDiagCtxt::new(ErrorOutputType::default()); + let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default()); - rustc_driver::init_rustc_env_logger(&handler); + rustc_driver::init_rustc_env_logger(&early_dcx); let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| { // FIXME: this macro calls unwrap internally but is called in a panicking context! It's not -- cgit 1.4.1-3-g733a5