about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/errors.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-09-14 06:03:22 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2025-09-14 12:38:12 +0200
commitec7ad59789138871418362d9592b1e848bab4053 (patch)
treede6e1b7f7a895f663e2cd4b624e3dfb19c6b7b73 /compiler/rustc_interface/src/errors.rs
parent27a180a31a10bad8d5116146459a49a16b4f3866 (diff)
downloadrust-ec7ad59789138871418362d9592b1e848bab4053.tar.gz
rust-ec7ad59789138871418362d9592b1e848bab4053.zip
Move more early buffered lints to dyn lint diagnostics (4/N)
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
-rw-r--r--compiler/rustc_interface/src/errors.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs
index d1082eaf617..727e09c7562 100644
--- a/compiler/rustc_interface/src/errors.rs
+++ b/compiler/rustc_interface/src/errors.rs
@@ -1,7 +1,7 @@
 use std::io;
 use std::path::Path;
 
-use rustc_macros::Diagnostic;
+use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
 use rustc_span::{Span, Symbol};
 
 #[derive(Diagnostic)]
@@ -108,3 +108,18 @@ pub(crate) struct AbiRequiredTargetFeature<'a> {
     pub feature: &'a str,
     pub enabled: &'a str,
 }
+
+#[derive(LintDiagnostic)]
+#[diag(interface_invalid_crate_type_value)]
+pub(crate) struct UnknownCrateTypes {
+    #[subdiagnostic]
+    pub sugg: Option<UnknownCrateTypesSub>,
+}
+
+#[derive(Subdiagnostic)]
+#[suggestion(interface_suggestion, code = r#""{snippet}""#, applicability = "maybe-incorrect")]
+pub(crate) struct UnknownCrateTypesSub {
+    #[primary_span]
+    pub span: Span,
+    pub snippet: Symbol,
+}