Skip to content

Commit cde19c0

Browse files
committed
Rename Handler as DiagCtxt.
1 parent 321b656 commit cde19c0

File tree

58 files changed

+216
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+216
-204
lines changed

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'a> AstValidator<'a> {
220220
}
221221
}
222222

223-
fn err_handler(&self) -> &rustc_errors::Handler {
223+
fn err_handler(&self) -> &rustc_errors::DiagCtxt {
224224
self.session.diagnostic()
225225
}
226226

@@ -697,7 +697,7 @@ impl<'a> AstValidator<'a> {
697697
/// Checks that generic parameters are in the correct order,
698698
/// which is lifetimes, then types and then consts. (`<'a, T, const N: usize>`)
699699
fn validate_generic_param_order(
700-
handler: &rustc_errors::Handler,
700+
handler: &rustc_errors::DiagCtxt,
701701
generics: &[GenericParam],
702702
span: Span,
703703
) {

compiler/rustc_ast_passes/src/show_span.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl FromStr for Mode {
3131
}
3232

3333
struct ShowSpanVisitor<'a> {
34-
span_diagnostic: &'a rustc_errors::Handler,
34+
span_diagnostic: &'a rustc_errors::DiagCtxt,
3535
mode: Mode,
3636
}
3737

@@ -58,7 +58,7 @@ impl<'a> Visitor<'a> for ShowSpanVisitor<'a> {
5858
}
5959
}
6060

61-
pub fn run(span_diagnostic: &rustc_errors::Handler, mode: &str, krate: &ast::Crate) {
61+
pub fn run(span_diagnostic: &rustc_errors::DiagCtxt, mode: &str, krate: &ast::Crate) {
6262
let Ok(mode) = mode.parse() else {
6363
return;
6464
};

compiler/rustc_attr/src/session_diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::num::IntErrorKind;
22

33
use rustc_ast as ast;
44
use rustc_errors::{
5-
error_code, Applicability, DiagnosticBuilder, ErrorGuaranteed, Handler, IntoDiagnostic,
5+
error_code, Applicability, DiagCtxt, DiagnosticBuilder, ErrorGuaranteed, IntoDiagnostic,
66
};
77
use rustc_macros::Diagnostic;
88
use rustc_span::{Span, Symbol};
@@ -51,7 +51,7 @@ pub(crate) struct UnknownMetaItem<'a> {
5151

5252
// Manual implementation to be able to format `expected` items correctly.
5353
impl<'a> IntoDiagnostic<'a> for UnknownMetaItem<'_> {
54-
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
54+
fn into_diagnostic(self, handler: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
5555
let expected = self.expected.iter().map(|name| format!("`{name}`")).collect::<Vec<_>>();
5656
let mut diag = handler.struct_span_err_with_code(
5757
self.span,
@@ -201,7 +201,7 @@ pub(crate) struct UnsupportedLiteral {
201201
}
202202

203203
impl<'a> IntoDiagnostic<'a> for UnsupportedLiteral {
204-
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
204+
fn into_diagnostic(self, handler: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
205205
let mut diag = handler.struct_span_err_with_code(
206206
self.span,
207207
match self.reason {

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ impl UseSpans<'_> {
624624
/// Add a subdiagnostic to the use of the captured variable, if it exists.
625625
pub(super) fn var_subdiag(
626626
self,
627-
handler: Option<&rustc_errors::Handler>,
627+
handler: Option<&rustc_errors::DiagCtxt>,
628628
err: &mut Diagnostic,
629629
kind: Option<rustc_middle::mir::BorrowKind>,
630630
f: impl FnOnce(Option<CoroutineKind>, Span) -> CaptureVarCause,

compiler/rustc_builtin_macros/src/errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_errors::{
2-
AddToDiagnostic, DiagnosticBuilder, ErrorGuaranteed, Handler, IntoDiagnostic, MultiSpan,
2+
AddToDiagnostic, DiagCtxt, DiagnosticBuilder, ErrorGuaranteed, IntoDiagnostic, MultiSpan,
33
SingleLabelManySpans,
44
};
55
use rustc_macros::{Diagnostic, Subdiagnostic};
@@ -448,7 +448,7 @@ pub(crate) struct EnvNotDefinedWithUserMessage {
448448
// Hand-written implementation to support custom user messages.
449449
impl<'a> IntoDiagnostic<'a> for EnvNotDefinedWithUserMessage {
450450
#[track_caller]
451-
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
451+
fn into_diagnostic(self, handler: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
452452
#[expect(
453453
rustc::untranslatable_diagnostic,
454454
reason = "cannot translate user-provided messages"
@@ -802,7 +802,7 @@ pub(crate) struct AsmClobberNoReg {
802802
}
803803

804804
impl<'a> IntoDiagnostic<'a> for AsmClobberNoReg {
805-
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
805+
fn into_diagnostic(self, handler: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
806806
let mut diag =
807807
handler.struct_err(crate::fluent_generated::builtin_macros_asm_clobber_no_reg);
808808
diag.set_span(self.spans.clone());

compiler/rustc_builtin_macros/src/proc_macro_harness.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum ProcMacro {
3838
struct CollectProcMacros<'a> {
3939
macros: Vec<ProcMacro>,
4040
in_root: bool,
41-
handler: &'a rustc_errors::Handler,
41+
handler: &'a rustc_errors::DiagCtxt,
4242
source_map: &'a SourceMap,
4343
is_proc_macro_crate: bool,
4444
is_test_crate: bool,
@@ -52,7 +52,7 @@ pub fn inject(
5252
is_proc_macro_crate: bool,
5353
has_proc_macro_decls: bool,
5454
is_test_crate: bool,
55-
handler: &rustc_errors::Handler,
55+
handler: &rustc_errors::DiagCtxt,
5656
) {
5757
let ecfg = ExpansionConfig::default("proc_macro".to_string(), features);
5858
let mut cx = ExtCtxt::new(sess, ecfg, resolver, None);

compiler/rustc_builtin_macros/src/test_harness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ fn get_test_name(i: &ast::Item) -> Option<Symbol> {
389389
attr::first_attr_value_str_by_name(&i.attrs, sym::rustc_test_marker)
390390
}
391391

392-
fn get_test_runner(sd: &rustc_errors::Handler, krate: &ast::Crate) -> Option<ast::Path> {
392+
fn get_test_runner(sd: &rustc_errors::DiagCtxt, krate: &ast::Crate) -> Option<ast::Path> {
393393
let test_attr = attr::find_by_name(&krate.attrs, sym::test_runner)?;
394394
let meta_list = test_attr.meta_item_list()?;
395395
let span = test_attr.span;

compiler/rustc_codegen_cranelift/src/concurrency_limiter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl ConcurrencyLimiter {
4646
}
4747
}
4848

49-
pub(super) fn acquire(&mut self, handler: &rustc_errors::Handler) -> ConcurrencyLimiterToken {
49+
pub(super) fn acquire(&mut self, handler: &rustc_errors::DiagCtxt) -> ConcurrencyLimiterToken {
5050
let mut state = self.state.lock().unwrap();
5151
loop {
5252
state.assert_invariants();

compiler/rustc_codegen_gcc/src/back/lto.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput};
3030
use rustc_codegen_ssa::traits::*;
3131
use rustc_codegen_ssa::{looks_like_rust_object_file, ModuleCodegen, ModuleKind};
3232
use rustc_data_structures::memmap::Mmap;
33-
use rustc_errors::{FatalError, Handler};
33+
use rustc_errors::{FatalError, DiagCtxt};
3434
use rustc_hir::def_id::LOCAL_CRATE;
3535
use rustc_middle::dep_graph::WorkProduct;
3636
use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel};
@@ -61,7 +61,7 @@ struct LtoData {
6161
tmp_path: TempDir,
6262
}
6363

64-
fn prepare_lto(cgcx: &CodegenContext<GccCodegenBackend>, diag_handler: &Handler) -> Result<LtoData, FatalError> {
64+
fn prepare_lto(cgcx: &CodegenContext<GccCodegenBackend>, diag_handler: &DiagCtxt) -> Result<LtoData, FatalError> {
6565
let export_threshold = match cgcx.lto {
6666
// We're just doing LTO for our one crate
6767
Lto::ThinLocal => SymbolExportLevel::Rust,
@@ -192,7 +192,7 @@ pub(crate) fn run_fat(
192192
)
193193
}
194194

195-
fn fat_lto(cgcx: &CodegenContext<GccCodegenBackend>, _diag_handler: &Handler, modules: Vec<FatLtoInput<GccCodegenBackend>>, cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>, mut serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>, tmp_path: TempDir,
195+
fn fat_lto(cgcx: &CodegenContext<GccCodegenBackend>, _diag_handler: &DiagCtxt, modules: Vec<FatLtoInput<GccCodegenBackend>>, cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>, mut serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>, tmp_path: TempDir,
196196
//symbols_below_threshold: &[*const libc::c_char],
197197
) -> Result<LtoModuleCodegen<GccCodegenBackend>, FatalError> {
198198
let _timer = cgcx.prof.generic_activity("GCC_fat_lto_build_monolithic_module");

compiler/rustc_codegen_gcc/src/back/write.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use gccjit::OutputKind;
44
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen};
55
use rustc_codegen_ssa::back::link::ensure_removed;
66
use rustc_codegen_ssa::back::write::{BitcodeSection, CodegenContext, EmitObj, ModuleConfig};
7-
use rustc_errors::Handler;
7+
use rustc_errors::DiagCtxt;
88
use rustc_fs_util::link_or_copy;
99
use rustc_session::config::OutputType;
1010
use rustc_span::fatal_error::FatalError;
@@ -13,7 +13,7 @@ use rustc_target::spec::SplitDebuginfo;
1313
use crate::{GccCodegenBackend, GccContext};
1414
use crate::errors::CopyBitcode;
1515

16-
pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, diag_handler: &Handler, module: ModuleCodegen<GccContext>, config: &ModuleConfig) -> Result<CompiledModule, FatalError> {
16+
pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, diag_handler: &DiagCtxt, module: ModuleCodegen<GccContext>, config: &ModuleConfig) -> Result<CompiledModule, FatalError> {
1717
let _timer = cgcx.prof.generic_activity_with_arg("GCC_module_codegen", &*module.name);
1818
{
1919
let context = &module.module_llvm.context;
@@ -148,7 +148,7 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, diag_hand
148148
))
149149
}
150150

151-
pub(crate) fn link(_cgcx: &CodegenContext<GccCodegenBackend>, _diag_handler: &Handler, mut _modules: Vec<ModuleCodegen<GccContext>>) -> Result<ModuleCodegen<GccContext>, FatalError> {
151+
pub(crate) fn link(_cgcx: &CodegenContext<GccCodegenBackend>, _diag_handler: &DiagCtxt, mut _modules: Vec<ModuleCodegen<GccContext>>) -> Result<ModuleCodegen<GccContext>, FatalError> {
152152
unimplemented!();
153153
}
154154

compiler/rustc_codegen_gcc/src/errors.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use rustc_errors::{
2-
DiagnosticArgValue, DiagnosticBuilder, ErrorGuaranteed, Handler, IntoDiagnostic, IntoDiagnosticArg,
2+
DiagCtxt, DiagnosticArgValue, DiagnosticBuilder, ErrorGuaranteed, IntoDiagnostic,
3+
IntoDiagnosticArg,
34
};
45
use rustc_macros::{Diagnostic, Subdiagnostic};
56
use rustc_span::Span;
@@ -111,7 +112,7 @@ pub(crate) struct TargetFeatureDisableOrEnable<'a> {
111112
pub(crate) struct MissingFeatures;
112113

113114
impl IntoDiagnostic<'_, ErrorGuaranteed> for TargetFeatureDisableOrEnable<'_> {
114-
fn into_diagnostic(self, handler: &'_ Handler) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
115+
fn into_diagnostic(self, handler: &'_ DiagCtxt) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
115116
let mut diag = handler.struct_err(fluent::codegen_gcc_target_feature_disable_or_enable);
116117
if let Some(span) = self.span {
117118
diag.set_span(span);

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModul
100100
use rustc_data_structures::fx::FxIndexMap;
101101
use rustc_data_structures::sync::IntoDynSyncSend;
102102
use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, ThinBufferMethods, WriteBackendMethods};
103-
use rustc_errors::{ErrorGuaranteed, Handler};
103+
use rustc_errors::{ErrorGuaranteed, DiagCtxt};
104104
use rustc_metadata::EncodedMetadata;
105105
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
106106
use rustc_middle::util::Providers;
@@ -330,7 +330,7 @@ impl WriteBackendMethods for GccCodegenBackend {
330330
unimplemented!()
331331
}
332332

333-
unsafe fn optimize(_cgcx: &CodegenContext<Self>, _diag_handler: &Handler, module: &ModuleCodegen<Self::Module>, config: &ModuleConfig) -> Result<(), FatalError> {
333+
unsafe fn optimize(_cgcx: &CodegenContext<Self>, _diag_handler: &DiagCtxt, module: &ModuleCodegen<Self::Module>, config: &ModuleConfig) -> Result<(), FatalError> {
334334
module.module_llvm.context.set_optimization_level(to_gcc_opt_level(config.opt_level));
335335
Ok(())
336336
}
@@ -344,7 +344,7 @@ impl WriteBackendMethods for GccCodegenBackend {
344344
unimplemented!();
345345
}
346346

347-
unsafe fn codegen(cgcx: &CodegenContext<Self>, diag_handler: &Handler, module: ModuleCodegen<Self::Module>, config: &ModuleConfig) -> Result<CompiledModule, FatalError> {
347+
unsafe fn codegen(cgcx: &CodegenContext<Self>, diag_handler: &DiagCtxt, module: ModuleCodegen<Self::Module>, config: &ModuleConfig) -> Result<CompiledModule, FatalError> {
348348
back::write::codegen(cgcx, diag_handler, module, config)
349349
}
350350

@@ -356,7 +356,7 @@ impl WriteBackendMethods for GccCodegenBackend {
356356
unimplemented!();
357357
}
358358

359-
fn run_link(cgcx: &CodegenContext<Self>, diag_handler: &Handler, modules: Vec<ModuleCodegen<Self::Module>>) -> Result<ModuleCodegen<Self::Module>, FatalError> {
359+
fn run_link(cgcx: &CodegenContext<Self>, diag_handler: &DiagCtxt, modules: Vec<ModuleCodegen<Self::Module>>) -> Result<ModuleCodegen<Self::Module>, FatalError> {
360360
back::write::link(cgcx, diag_handler, modules)
361361
}
362362
}

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_codegen_ssa::traits::*;
1414
use rustc_codegen_ssa::{looks_like_rust_object_file, ModuleCodegen, ModuleKind};
1515
use rustc_data_structures::fx::FxHashMap;
1616
use rustc_data_structures::memmap::Mmap;
17-
use rustc_errors::{FatalError, Handler};
17+
use rustc_errors::{DiagCtxt, FatalError};
1818
use rustc_hir::def_id::LOCAL_CRATE;
1919
use rustc_middle::bug;
2020
use rustc_middle::dep_graph::WorkProduct;
@@ -47,7 +47,7 @@ pub fn crate_type_allows_lto(crate_type: CrateType) -> bool {
4747

4848
fn prepare_lto(
4949
cgcx: &CodegenContext<LlvmCodegenBackend>,
50-
diag_handler: &Handler,
50+
diag_handler: &DiagCtxt,
5151
) -> Result<(Vec<CString>, Vec<(SerializedModule<ModuleBuffer>, CString)>), FatalError> {
5252
let export_threshold = match cgcx.lto {
5353
// We're just doing LTO for our one crate
@@ -250,7 +250,7 @@ pub(crate) fn prepare_thin(module: ModuleCodegen<ModuleLlvm>) -> (String, ThinBu
250250

251251
fn fat_lto(
252252
cgcx: &CodegenContext<LlvmCodegenBackend>,
253-
diag_handler: &Handler,
253+
diag_handler: &DiagCtxt,
254254
modules: Vec<FatLtoInput<LlvmCodegenBackend>>,
255255
cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
256256
mut serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>,
@@ -452,7 +452,7 @@ impl Drop for Linker<'_> {
452452
/// they all go out of scope.
453453
fn thin_lto(
454454
cgcx: &CodegenContext<LlvmCodegenBackend>,
455-
diag_handler: &Handler,
455+
diag_handler: &DiagCtxt,
456456
modules: Vec<(String, ThinBuffer)>,
457457
serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>,
458458
cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
@@ -609,7 +609,7 @@ fn thin_lto(
609609

610610
pub(crate) fn run_pass_manager(
611611
cgcx: &CodegenContext<LlvmCodegenBackend>,
612-
diag_handler: &Handler,
612+
diag_handler: &DiagCtxt,
613613
module: &mut ModuleCodegen<ModuleLlvm>,
614614
thin: bool,
615615
) -> Result<(), FatalError> {
@@ -868,7 +868,7 @@ pub fn parse_module<'a>(
868868
cx: &'a llvm::Context,
869869
name: &CStr,
870870
data: &[u8],
871-
diag_handler: &Handler,
871+
diag_handler: &DiagCtxt,
872872
) -> Result<&'a llvm::Module, FatalError> {
873873
unsafe {
874874
llvm::LLVMRustParseBitcodeForLTO(cx, data.as_ptr(), data.len(), name.as_ptr())

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustc_codegen_ssa::traits::*;
2626
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen};
2727
use rustc_data_structures::profiling::SelfProfilerRef;
2828
use rustc_data_structures::small_c_str::SmallCStr;
29-
use rustc_errors::{FatalError, Handler, Level};
29+
use rustc_errors::{DiagCtxt, FatalError, Level};
3030
use rustc_fs_util::{link_or_copy, path_to_c_string};
3131
use rustc_middle::ty::TyCtxt;
3232
use rustc_session::config::{self, Lto, OutputType, Passes, SplitDwarfKind, SwitchWithOptPath};
@@ -45,15 +45,15 @@ use std::slice;
4545
use std::str;
4646
use std::sync::Arc;
4747

48-
pub fn llvm_err<'a>(handler: &rustc_errors::Handler, err: LlvmError<'a>) -> FatalError {
48+
pub fn llvm_err<'a>(handler: &rustc_errors::DiagCtxt, err: LlvmError<'a>) -> FatalError {
4949
match llvm::last_error() {
5050
Some(llvm_err) => handler.emit_almost_fatal(WithLlvmError(err, llvm_err)),
5151
None => handler.emit_almost_fatal(err),
5252
}
5353
}
5454

5555
pub fn write_output_file<'ll>(
56-
handler: &rustc_errors::Handler,
56+
handler: &rustc_errors::DiagCtxt,
5757
target: &'ll llvm::TargetMachine,
5858
pm: &llvm::PassManager<'ll>,
5959
m: &'ll llvm::Module,
@@ -332,15 +332,15 @@ pub enum CodegenDiagnosticsStage {
332332
}
333333

334334
pub struct DiagnosticHandlers<'a> {
335-
data: *mut (&'a CodegenContext<LlvmCodegenBackend>, &'a Handler),
335+
data: *mut (&'a CodegenContext<LlvmCodegenBackend>, &'a DiagCtxt),
336336
llcx: &'a llvm::Context,
337337
old_handler: Option<&'a llvm::DiagnosticHandler>,
338338
}
339339

340340
impl<'a> DiagnosticHandlers<'a> {
341341
pub fn new(
342342
cgcx: &'a CodegenContext<LlvmCodegenBackend>,
343-
handler: &'a Handler,
343+
handler: &'a DiagCtxt,
344344
llcx: &'a llvm::Context,
345345
module: &ModuleCodegen<ModuleLlvm>,
346346
stage: CodegenDiagnosticsStage,
@@ -429,7 +429,7 @@ unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void
429429
if user.is_null() {
430430
return;
431431
}
432-
let (cgcx, diag_handler) = *(user as *const (&CodegenContext<LlvmCodegenBackend>, &Handler));
432+
let (cgcx, diag_handler) = *(user as *const (&CodegenContext<LlvmCodegenBackend>, &DiagCtxt));
433433

434434
match llvm::diagnostic::Diagnostic::unpack(info) {
435435
llvm::diagnostic::InlineAsm(inline) => {
@@ -507,7 +507,7 @@ fn get_instr_profile_output_path(config: &ModuleConfig) -> Option<CString> {
507507

508508
pub(crate) unsafe fn llvm_optimize(
509509
cgcx: &CodegenContext<LlvmCodegenBackend>,
510-
diag_handler: &Handler,
510+
diag_handler: &DiagCtxt,
511511
module: &ModuleCodegen<ModuleLlvm>,
512512
config: &ModuleConfig,
513513
opt_level: config::OptLevel,
@@ -594,7 +594,7 @@ pub(crate) unsafe fn llvm_optimize(
594594
// Unsafe due to LLVM calls.
595595
pub(crate) unsafe fn optimize(
596596
cgcx: &CodegenContext<LlvmCodegenBackend>,
597-
diag_handler: &Handler,
597+
diag_handler: &DiagCtxt,
598598
module: &ModuleCodegen<ModuleLlvm>,
599599
config: &ModuleConfig,
600600
) -> Result<(), FatalError> {
@@ -628,7 +628,7 @@ pub(crate) unsafe fn optimize(
628628

629629
pub(crate) fn link(
630630
cgcx: &CodegenContext<LlvmCodegenBackend>,
631-
diag_handler: &Handler,
631+
diag_handler: &DiagCtxt,
632632
mut modules: Vec<ModuleCodegen<ModuleLlvm>>,
633633
) -> Result<ModuleCodegen<ModuleLlvm>, FatalError> {
634634
use super::lto::{Linker, ModuleBuffer};
@@ -651,7 +651,7 @@ pub(crate) fn link(
651651

652652
pub(crate) unsafe fn codegen(
653653
cgcx: &CodegenContext<LlvmCodegenBackend>,
654-
diag_handler: &Handler,
654+
diag_handler: &DiagCtxt,
655655
module: ModuleCodegen<ModuleLlvm>,
656656
config: &ModuleConfig,
657657
) -> Result<CompiledModule, FatalError> {

0 commit comments

Comments
 (0)