1
Fork 0

Delay diagnostic translation in rustc_codegen_ssa

This commit is contained in:
SLASHLogin 2022-11-02 19:23:05 +01:00
parent 9a1545861e
commit b4820a3b94
2 changed files with 27 additions and 9 deletions

View file

@ -44,6 +44,15 @@ pub trait IntoDiagnosticArg {
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static>;
}
impl<'source> IntoDiagnosticArg for DiagnosticArgValue<'source> {
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
match self {
DiagnosticArgValue::Str(s) => DiagnosticArgValue::Str(Cow::Owned(s.into_owned())),
DiagnosticArgValue::Number(n) => DiagnosticArgValue::Number(n),
}
}
}
impl<'source> Into<FluentValue<'source>> for DiagnosticArgValue<'source> {
fn into(self) -> FluentValue<'source> {
match self {