Migrate parts of rustc_expand to session diagnostics
This migrates everything but the `mbe` and `proc_macro` modules. It also contains a few cleanups and drive-by/accidental diagnostic improvements which can be seen in the diff for the UI tests.
This commit is contained in:
@@ -152,6 +152,12 @@ impl IntoDiagnosticArg for ast::Path {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for &ast::Path {
|
||||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
||||
DiagnosticArgValue::Str(Cow::Owned(pprust::path_to_string(self)))
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for ast::token::Token {
|
||||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
||||
DiagnosticArgValue::Str(pprust::token_to_string(&self))
|
||||
|
||||
Reference in New Issue
Block a user