Use a dedicated type instead of a reference for the diagnostic context

This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
This commit is contained in:
Oli Scherer 2024-06-18 10:35:56 +00:00
parent 7218fdd2db
commit 4b7ae63fbf

View File

@ -180,12 +180,12 @@ pub fn main() {
rustc_driver::init_rustc_env_logger(&early_dcx); rustc_driver::init_rustc_env_logger(&early_dcx);
let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| { let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |dcx| {
// FIXME: this macro calls unwrap internally but is called in a panicking context! It's not // FIXME: this macro calls unwrap internally but is called in a panicking context! It's not
// as simple as moving the call from the hook to main, because `install_ice_hook` doesn't // as simple as moving the call from the hook to main, because `install_ice_hook` doesn't
// accept a generic closure. // accept a generic closure.
let version_info = rustc_tools_util::get_version_info!(); let version_info = rustc_tools_util::get_version_info!();
handler.note(format!("Clippy version: {version_info}")); dcx.handle().note(format!("Clippy version: {version_info}"));
}); });
exit(rustc_driver::catch_with_exit_code(move || { exit(rustc_driver::catch_with_exit_code(move || {