about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-09-22 12:15:28 +0200
committerGitHub <noreply@github.com>2023-09-22 12:15:28 +0200
commit1a18ec0dcf88f35b4682e7f630cbd3b167b56e92 (patch)
tree78672d40e8205615ffab5c002aefa80795282769 /compiler/rustc_errors
parent66f272d6ca9faf897a8cd668f2b0c9ce42ec507d (diff)
parent7abbb9a4ffb17af4fea40222264ed87c736310e6 (diff)
downloadrust-1a18ec0dcf88f35b4682e7f630cbd3b167b56e92.tar.gz
rust-1a18ec0dcf88f35b4682e7f630cbd3b167b56e92.zip
Rollup merge of #116049 - RalfJung:future-incompat, r=Nilstrieb
give FutureIncompatibilityReason variants more explicit names

Also make the `reason` field mandatory when declaring a lint, to make sure this is a deliberate decision.
Diffstat (limited to 'compiler/rustc_errors')
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index 3fd087b1d5e..470f318eb33 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -151,7 +151,12 @@ impl fmt::Display for DiagnosticLocation {
 #[derive(Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable)]
 pub enum DiagnosticId {
     Error(String),
-    Lint { name: String, has_future_breakage: bool, is_force_warn: bool },
+    Lint {
+        name: String,
+        /// Indicates whether this lint should show up in cargo's future breakage report.
+        has_future_breakage: bool,
+        is_force_warn: bool,
+    },
 }
 
 /// A "sub"-diagnostic attached to a parent diagnostic.
@@ -301,6 +306,7 @@ impl Diagnostic {
         }
     }
 
+    /// Indicates whether this diagnostic should show up in cargo's future breakage report.
     pub fn has_future_breakage(&self) -> bool {
         match self.code {
             Some(DiagnosticId::Lint { has_future_breakage, .. }) => has_future_breakage,