@@ -102,12 +102,12 @@ pub(crate) struct DynamicLinkingWithLTO;
102102pub ( crate ) struct ParseTargetMachineConfig < ' a > ( pub LlvmError < ' a > ) ;
103103
104104impl < EM : EmissionGuarantee > IntoDiagnostic < ' _ , EM > for ParseTargetMachineConfig < ' _ > {
105- fn into_diagnostic ( self , sess : & ' _ Handler ) -> DiagnosticBuilder < ' _ , EM > {
106- let diag: DiagnosticBuilder < ' _ , EM > = self . 0 . into_diagnostic ( sess ) ;
105+ fn into_diagnostic ( self , handler : & ' _ Handler ) -> DiagnosticBuilder < ' _ , EM > {
106+ let diag: DiagnosticBuilder < ' _ , EM > = self . 0 . into_diagnostic ( handler ) ;
107107 let ( message, _) = diag. styled_message ( ) . first ( ) . expect ( "`LlvmError` with no message" ) ;
108- let message = sess . eagerly_translate_to_string ( message. clone ( ) , diag. args ( ) ) ;
108+ let message = handler . eagerly_translate_to_string ( message. clone ( ) , diag. args ( ) ) ;
109109
110- let mut diag = sess . struct_diagnostic ( fluent:: codegen_llvm_parse_target_machine_config) ;
110+ let mut diag = handler . struct_diagnostic ( fluent:: codegen_llvm_parse_target_machine_config) ;
111111 diag. set_arg ( "error" , message) ;
112112 diag
113113 }
@@ -124,8 +124,8 @@ pub(crate) struct TargetFeatureDisableOrEnable<'a> {
124124pub ( crate ) struct MissingFeatures ;
125125
126126impl IntoDiagnostic < ' _ , ErrorGuaranteed > for TargetFeatureDisableOrEnable < ' _ > {
127- fn into_diagnostic ( self , sess : & ' _ Handler ) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
128- let mut diag = sess . struct_err ( fluent:: codegen_llvm_target_feature_disable_or_enable) ;
127+ fn into_diagnostic ( self , handler : & ' _ Handler ) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
128+ let mut diag = handler . struct_err ( fluent:: codegen_llvm_target_feature_disable_or_enable) ;
129129 if let Some ( span) = self . span {
130130 diag. set_span ( span) ;
131131 } ;
@@ -184,7 +184,7 @@ pub enum LlvmError<'a> {
184184pub ( crate ) struct WithLlvmError < ' a > ( pub LlvmError < ' a > , pub String ) ;
185185
186186impl < EM : EmissionGuarantee > IntoDiagnostic < ' _ , EM > for WithLlvmError < ' _ > {
187- fn into_diagnostic ( self , sess : & ' _ Handler ) -> DiagnosticBuilder < ' _ , EM > {
187+ fn into_diagnostic ( self , handler : & ' _ Handler ) -> DiagnosticBuilder < ' _ , EM > {
188188 use LlvmError :: * ;
189189 let msg_with_llvm_err = match & self . 0 {
190190 WriteOutput { .. } => fluent:: codegen_llvm_write_output_with_llvm_err,
@@ -201,7 +201,7 @@ impl<EM: EmissionGuarantee> IntoDiagnostic<'_, EM> for WithLlvmError<'_> {
201201 PrepareThinLtoModule => fluent:: codegen_llvm_prepare_thin_lto_module_with_llvm_err,
202202 ParseBitcode => fluent:: codegen_llvm_parse_bitcode_with_llvm_err,
203203 } ;
204- let mut diag = self . 0 . into_diagnostic ( sess ) ;
204+ let mut diag = self . 0 . into_diagnostic ( handler ) ;
205205 diag. set_primary_message ( msg_with_llvm_err) ;
206206 diag. set_arg ( "llvm_err" , self . 1 ) ;
207207 diag
0 commit comments