pub struct LintPolicy {
pub overrides: BTreeMap<String, LintLevel>,
pub deny_warnings: bool,
}Expand description
The resolved [lints] policy (issue #1160): per-code severity overrides
plus the blanket deny-warnings flag. Bundled as its own small,
cheaply-PartialEq-comparable value — rather than as two loose scalars —
so brink-db’s severity-partitioning call sites can share one narrow
salsa projection the same way TypePolicy already does (see
brink-db’s type_policy_query/lint_policy_query doc comments for the
cutoff argument).
This is the AnalysisOptions::lints field’s type — resolved once, at
Project::load (via AnalysisOptions::apply_project_config), never
re-derived at a call site (#1160’s “apply it at the ONE point” mandate).
Fields§
§overrides: BTreeMap<String, LintLevel>Per-code overrides, keyed by the diagnostic code’s string form
(DiagnosticCode::as_str, e.g. "E063"). Only ever consulted for
codes whose default severity (brink_ir::DiagnosticCode::severity)
is Warning — see effective_severity’s doc comment for why a
hard-error-by-default code is never even looked up here.
deny_warnings: bool[lints] deny-warnings = true: promote every diagnostic that would
otherwise resolve to Warning up to Error (the -D warnings
equivalent). A code with an explicit Self::overrides entry is
unaffected by this flag — Deny is Error either way, and Allow
is specifically the “stay Warning even under deny-warnings” knob.
Trait Implementations§
Source§impl Clone for LintPolicy
impl Clone for LintPolicy
Source§fn clone(&self) -> LintPolicy
fn clone(&self) -> LintPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LintPolicy
impl Debug for LintPolicy
Source§impl Default for LintPolicy
impl Default for LintPolicy
Source§fn default() -> LintPolicy
fn default() -> LintPolicy
Source§impl<'de> Deserialize<'de> for LintPolicy
impl<'de> Deserialize<'de> for LintPolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LintPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LintPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for LintPolicy
Source§impl PartialEq for LintPolicy
impl PartialEq for LintPolicy
Source§impl Serialize for LintPolicy
impl Serialize for LintPolicy
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for LintPolicy
Auto Trait Implementations§
impl Freeze for LintPolicy
impl RefUnwindSafe for LintPolicy
impl Send for LintPolicy
impl Sync for LintPolicy
impl Unpin for LintPolicy
impl UnsafeUnpin for LintPolicy
impl UnwindSafe for LintPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.