Skip to content

Commit 059cc85

Browse files
committed
impl IntoDiagArg for TokenTree
1 parent 2e70828 commit 059cc85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_errors/src/diagnostic_impls.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ impl IntoDiagArg for ast::token::TokenKind {
230230
}
231231
}
232232

233+
impl IntoDiagArg for ast::tokenstream::TokenTree {
234+
fn into_diag_arg(self) -> DiagArgValue {
235+
DiagArgValue::Str(Cow::Owned(pprust::tt_to_string(&self)))
236+
}
237+
}
238+
233239
impl IntoDiagArg for FloatTy {
234240
fn into_diag_arg(self) -> DiagArgValue {
235241
DiagArgValue::Str(Cow::Borrowed(self.name_str()))

0 commit comments

Comments
 (0)