about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-18 14:13:35 +0100
committerGitHub <noreply@github.com>2022-11-18 14:13:35 +0100
commit3e5965722ca46b82cc68cb1acdddf7e187a6ee02 (patch)
treea668bca64fad76a42acd29499e480c216e30f37d /compiler/rustc_errors/src
parent9d46c7a3e69966782e163877151c1f0cea8b630a (diff)
parent269ce369fee929cf72a75ddbd4f640fd544756d3 (diff)
downloadrust-3e5965722ca46b82cc68cb1acdddf7e187a6ee02.tar.gz
rust-3e5965722ca46b82cc68cb1acdddf7e187a6ee02.zip
Rollup merge of #101162 - rajputrajat:master, r=davidtwco
Migrate rustc_resolve to use SessionDiagnostic, part # 1

crate a somewhat on larger size, so plz allow some time to get it finished.
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 c6035705e39..ee68344805f 100644
--- a/compiler/rustc_errors/src/diagnostic_impls.rs
+++ b/compiler/rustc_errors/src/diagnostic_impls.rs
@@ -211,6 +211,12 @@ impl IntoDiagnosticArg for DiagnosticSymbolList {
     }
 }
 
+impl<Id> IntoDiagnosticArg for hir::def::Res<Id> {
+    fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
+        DiagnosticArgValue::Str(Cow::Borrowed(self.descr()))
+    }
+}
+
 impl IntoDiagnostic<'_, !> for TargetDataLayoutErrors<'_> {
     fn into_diagnostic(self, handler: &Handler) -> DiagnosticBuilder<'_, !> {
         let mut diag;