about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-10 16:37:36 +0000
committerbors <bors@rust-lang.org>2022-12-10 16:37:36 +0000
commit32da2305880765a4c76180086959a2d5da131565 (patch)
treee7e308e24979d511dcff466951bcfa6acec44348 /compiler/rustc_errors/src
parenta161a7b654083a881b22908a475988bcc3221a79 (diff)
parentab505298ea4cf338403eeaa94c4458b5ad9530db (diff)
downloadrust-32da2305880765a4c76180086959a2d5da131565.tar.gz
rust-32da2305880765a4c76180086959a2d5da131565.zip
Auto merge of #105531 - matthiaskrgr:rollup-7y7zbgl, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #104460 (Migrate parts of `rustc_expand` to session diagnostics)
 - #105192 (Point at LHS on binop type err if relevant)
 - #105234 (Remove unneeded field from `SwitchTargets`)
 - #105239 (Avoid heap allocation when truncating thread names)
 - #105410 (Consider `parent_count` for const param defaults)
 - #105482 (Fix invalid codegen during debuginfo lowering)

Failed merges:

 - #105411 (Introduce `with_forced_trimmed_paths`)

r? `@ghost`
`@rustbot` modify labels: rollup
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))