Rename EarlyErrorHandler as EarlyDiagCtxt.

This commit is contained in:
Nicholas Nethercote 2023-12-17 22:01:06 +11:00
parent 576b9213b3
commit b44315c34c
2 changed files with 3 additions and 4 deletions

View File

@ -176,7 +176,7 @@ pub(crate) fn compile_fn(
match module.define_function(codegened_func.func_id, context) { match module.define_function(codegened_func.func_id, context) {
Ok(()) => {} Ok(()) => {}
Err(ModuleError::Compilation(CodegenError::ImplLimitExceeded)) => { Err(ModuleError::Compilation(CodegenError::ImplLimitExceeded)) => {
let handler = rustc_session::EarlyErrorHandler::new( let handler = rustc_session::EarlyDiagCtxt::new(
rustc_session::config::ErrorOutputType::default(), rustc_session::config::ErrorOutputType::default(),
); );
handler.early_error(format!( handler.early_error(format!(

View File

@ -231,9 +231,8 @@ 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
let handler = rustc_session::EarlyErrorHandler::new( let handler =
rustc_session::config::ErrorOutputType::default(), rustc_session::EarlyDiagCtxt::new(rustc_session::config::ErrorOutputType::default());
);
handler.early_warn(format!("error writing ir file: {}", err)); handler.early_warn(format!("error writing ir file: {}", err));
} }
} }