Skip to content

More translatable diagnostics #123822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
6 changes: 6 additions & 0 deletions compiler/rustc_errors/src/diagnostic_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ impl IntoDiagArg for ast::token::TokenKind {
}
}

impl IntoDiagArg for ast::tokenstream::TokenTree {
fn into_diag_arg(self) -> DiagArgValue {
DiagArgValue::Str(Cow::Owned(pprust::tt_to_string(&self)))
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this change in the commit where you actually use it?

impl IntoDiagArg for FloatTy {
fn into_diag_arg(self) -> DiagArgValue {
DiagArgValue::Str(Cow::Borrowed(self.name_str()))
Expand Down