diff options
Diffstat (limited to 'compiler/rustc_errors/src/diagnostic.rs')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 14ccced2c6a..45661ac1562 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -29,7 +29,7 @@ pub struct Diagnostic { #[derive(Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable)] pub enum DiagnosticId { Error(String), - Lint { name: String, has_future_breakage: bool }, + Lint { name: String, has_future_breakage: bool, is_force_warn: bool }, } /// A "sub"-diagnostic attached to a parent diagnostic. @@ -109,6 +109,13 @@ impl Diagnostic { } } + pub fn is_force_warn(&self) -> bool { + match self.code { + Some(DiagnosticId::Lint { is_force_warn, .. }) => is_force_warn, + _ => false, + } + } + /// Cancel the diagnostic (a structured diagnostic must either be emitted or /// canceled or it will panic when dropped). pub fn cancel(&mut self) { |
