Force warnings even when can_emit_warnings == false
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user