From 2ac2dc1cfa136df6367c18596704cf268f856dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= Date: Fri, 23 Jun 2023 05:56:09 +0800 Subject: [PATCH] Provide more context for `rustc +nightly -Zunstable-options` on stable --- src/driver.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/driver.rs b/src/driver.rs index 3c5b6e12b96..f3cc94aeff0 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -16,6 +16,8 @@ extern crate rustc_span; use rustc_interface::interface; +use rustc_session::EarlyErrorHandler; +use rustc_session::config::ErrorOutputType; use rustc_session::parse::ParseSess; use rustc_span::symbol::Symbol; @@ -187,7 +189,9 @@ fn display_help() { #[allow(clippy::too_many_lines)] pub fn main() { - rustc_driver::init_rustc_env_logger(); + let handler = EarlyErrorHandler::new(ErrorOutputType::default()); + + rustc_driver::init_rustc_env_logger(&handler); 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