@@ -102,12 +102,12 @@ pub(crate) struct DynamicLinkingWithLTO;
102
102
pub ( crate ) struct ParseTargetMachineConfig < ' a > ( pub LlvmError < ' a > ) ;
103
103
104
104
impl < 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 ) ;
107
107
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 ( ) ) ;
109
109
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) ;
111
111
diag. set_arg ( "error" , message) ;
112
112
diag
113
113
}
@@ -124,8 +124,8 @@ pub(crate) struct TargetFeatureDisableOrEnable<'a> {
124
124
pub ( crate ) struct MissingFeatures ;
125
125
126
126
impl 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) ;
129
129
if let Some ( span) = self . span {
130
130
diag. set_span ( span) ;
131
131
} ;
@@ -184,7 +184,7 @@ pub enum LlvmError<'a> {
184
184
pub ( crate ) struct WithLlvmError < ' a > ( pub LlvmError < ' a > , pub String ) ;
185
185
186
186
impl < EM : EmissionGuarantee > IntoDiagnostic < ' _ , EM > for WithLlvmError < ' _ > {
187
- fn into_diagnostic ( self , sess : & ' _ Handler ) -> DiagnosticBuilder < ' _ , EM > {
187
+ fn into_diagnostic ( self , handler : & ' _ Handler ) -> DiagnosticBuilder < ' _ , EM > {
188
188
use LlvmError :: * ;
189
189
let msg_with_llvm_err = match & self . 0 {
190
190
WriteOutput { .. } => fluent:: codegen_llvm_write_output_with_llvm_err,
@@ -201,7 +201,7 @@ impl<EM: EmissionGuarantee> IntoDiagnostic<'_, EM> for WithLlvmError<'_> {
201
201
PrepareThinLtoModule => fluent:: codegen_llvm_prepare_thin_lto_module_with_llvm_err,
202
202
ParseBitcode => fluent:: codegen_llvm_parse_bitcode_with_llvm_err,
203
203
} ;
204
- let mut diag = self . 0 . into_diagnostic ( sess ) ;
204
+ let mut diag = self . 0 . into_diagnostic ( handler ) ;
205
205
diag. set_primary_message ( msg_with_llvm_err) ;
206
206
diag. set_arg ( "llvm_err" , self . 1 ) ;
207
207
diag
0 commit comments