about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authornils <48135649+Nilstrieb@users.noreply.github.com>2022-11-15 14:24:33 +0100
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-12-10 11:02:41 +0100
commit2f9f097cb8b6c27a7e0d7a916e6911fc1f5ecd81 (patch)
tree3f5b890f89761f43f7d3071718491dcf72c4d285 /compiler/rustc_errors/src
parenta000811405e6a3ca9b0b129c1177e78564e09666 (diff)
downloadrust-2f9f097cb8b6c27a7e0d7a916e6911fc1f5ecd81.tar.gz
rust-2f9f097cb8b6c27a7e0d7a916e6911fc1f5ecd81.zip
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.
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic_impls.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs
index 7155db32e53..cb39e997436 100644
--- a/compiler/rustc_errors/src/diagnostic_impls.rs
+++ b/compiler/rustc_errors/src/diagnostic_impls.rs
@@ -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))