@@ -2,7 +2,7 @@ use std::ffi::CString;
22use std:: path:: Path ;
33
44use rustc_data_structures:: small_c_str:: SmallCStr ;
5- use rustc_errors:: { Diag , DiagCtxtHandle , Diagnostic , EmissionGuarantee , Level , inline_fluent } ;
5+ use rustc_errors:: { Diag , DiagCtxtHandle , Diagnostic , EmissionGuarantee , Level , msg } ;
66use rustc_macros:: Diagnostic ;
77use rustc_span:: Span ;
88
@@ -28,7 +28,7 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for ParseTargetMachineConfig<'_> {
2828 Diag :: new (
2929 dcx,
3030 level,
31- inline_fluent ! ( "failed to parse target machine config to target machine: {$error}" ) ,
31+ msg ! ( "failed to parse target machine config to target machine: {$error}" ) ,
3232 )
3333 . with_arg ( "error" , message)
3434 }
@@ -125,29 +125,29 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for WithLlvmError<'_> {
125125 fn into_diag ( self , dcx : DiagCtxtHandle < ' _ > , level : Level ) -> Diag < ' _ , G > {
126126 use LlvmError :: * ;
127127 let msg_with_llvm_err = match & self . 0 {
128- WriteOutput { .. } => inline_fluent ! ( "could not write output to {$path}: {$llvm_err}" ) ,
129- CreateTargetMachine { .. } => inline_fluent ! (
130- "could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err}"
131- ) ,
132- RunLlvmPasses => inline_fluent ! ( "failed to run LLVM passes: {$llvm_err}" ) ,
128+ WriteOutput { .. } => msg ! ( "could not write output to {$path}: {$llvm_err}" ) ,
129+ CreateTargetMachine { .. } => {
130+ msg ! ( "could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err}" )
131+ }
132+ RunLlvmPasses => msg ! ( "failed to run LLVM passes: {$llvm_err}" ) ,
133133 SerializeModule { .. } => {
134- inline_fluent ! ( "failed to serialize module {$name}: {$llvm_err}" )
134+ msg ! ( "failed to serialize module {$name}: {$llvm_err}" )
135135 }
136- WriteIr { .. } => inline_fluent ! ( "failed to write LLVM IR to {$path}: {$llvm_err}" ) ,
136+ WriteIr { .. } => msg ! ( "failed to write LLVM IR to {$path}: {$llvm_err}" ) ,
137137 PrepareThinLtoContext => {
138- inline_fluent ! ( "failed to prepare thin LTO context: {$llvm_err}" )
138+ msg ! ( "failed to prepare thin LTO context: {$llvm_err}" )
139139 }
140140 LoadBitcode { .. } => {
141- inline_fluent ! ( "failed to load bitcode of module \" {$name}\" : {$llvm_err}" )
141+ msg ! ( "failed to load bitcode of module \" {$name}\" : {$llvm_err}" )
142142 }
143143 WriteThinLtoKey { .. } => {
144- inline_fluent ! ( "error while writing ThinLTO key data: {$err}: {$llvm_err}" )
144+ msg ! ( "error while writing ThinLTO key data: {$err}: {$llvm_err}" )
145145 }
146146 PrepareThinLtoModule => {
147- inline_fluent ! ( "failed to prepare thin LTO module: {$llvm_err}" )
147+ msg ! ( "failed to prepare thin LTO module: {$llvm_err}" )
148148 }
149- ParseBitcode => inline_fluent ! ( "failed to parse bitcode for LTO module: {$llvm_err}" ) ,
150- PrepareAutoDiff { .. } => inline_fluent ! (
149+ ParseBitcode => msg ! ( "failed to parse bitcode for LTO module: {$llvm_err}" ) ,
150+ PrepareAutoDiff { .. } => msg ! (
151151 "failed to prepare autodiff: {$llvm_err}, src: {$src}, target: {$target}, {$error}"
152152 ) ,
153153 } ;
0 commit comments