about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/diagnostic_impls.rs
diff options
context:
space:
mode:
authorJana Dönszelmann <jana@donsz.nl>2025-02-09 22:49:33 +0100
committerJana Dönszelmann <jana@donsz.nl>2025-02-24 14:31:17 +0100
commit7e0f5b50168c63bd1879067c043559ef0f01671e (patch)
treeb2f1b1f68ef89985faec8ae287731613e4b520c4 /compiler/rustc_errors/src/diagnostic_impls.rs
parentdbd3b7928e91758296a0f6093d72f90214888133 (diff)
downloadrust-7e0f5b50168c63bd1879067c043559ef0f01671e.tar.gz
rust-7e0f5b50168c63bd1879067c043559ef0f01671e.zip
Introduce new-style attribute parsers for several attributes
note: compiler compiles but librustdoc and clippy don't
Diffstat (limited to 'compiler/rustc_errors/src/diagnostic_impls.rs')
-rw-r--r--compiler/rustc_errors/src/diagnostic_impls.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs
index 7f383946c14..db6532f41ea 100644
--- a/compiler/rustc_errors/src/diagnostic_impls.rs
+++ b/compiler/rustc_errors/src/diagnostic_impls.rs
@@ -8,6 +8,7 @@ use std::process::ExitStatus;
 use rustc_abi::TargetDataLayoutErrors;
 use rustc_ast::util::parser::ExprPrecedence;
 use rustc_ast_pretty::pprust;
+use rustc_attr_data_structures::RustcVersion;
 use rustc_macros::Subdiagnostic;
 use rustc_span::edition::Edition;
 use rustc_span::{Ident, MacroRulesNormalizedIdent, Span, Symbol};
@@ -96,6 +97,12 @@ into_diag_arg_using_display!(
     rustc_abi::ExternAbi,
 );
 
+impl IntoDiagArg for RustcVersion {
+    fn into_diag_arg(self) -> DiagArgValue {
+        DiagArgValue::Str(Cow::Owned(self.to_string()))
+    }
+}
+
 impl<I: rustc_type_ir::Interner> IntoDiagArg for rustc_type_ir::TraitRef<I> {
     fn into_diag_arg(self) -> DiagArgValue {
         self.to_string().into_diag_arg()