Provide more context for rustc +nightly -Zunstable-options on stable

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2023-06-23 05:56:09 +08:00
parent 7ba31b9938
commit 2cdf8a4c3f

View File

@ -225,10 +225,10 @@ pub(crate) fn write_ir_file(
let res = std::fs::File::create(clif_file_name).and_then(|mut file| write(&mut file)); let res = std::fs::File::create(clif_file_name).and_then(|mut file| write(&mut file));
if let Err(err) = res { if let Err(err) = res {
// Using early_warn as no Session is available here // Using early_warn as no Session is available here
rustc_session::early_warn( let handler = rustc_session::EarlyErrorHandler::new(
rustc_session::config::ErrorOutputType::default(), rustc_session::config::ErrorOutputType::default(),
format!("error writing ir file: {}", err),
); );
handler.early_warn(format!("error writing ir file: {}", err));
} }
} }