Struct naga::diagnostic_filter::DiagnosticFilterMap
source · pub(crate) struct DiagnosticFilterMap(IndexMap<FilterableTriggeringRule, (Severity, Span)>);
Expand description
A map from diagnostic filters to their severity and span.
Front ends can use this to collect the set of filters applied to a particular language construct, and detect duplicate/conflicting filters.
For example, WGSL has global diagnostic filters that apply to the entire
module, and diagnostic range filter attributes that apply to a specific
function, statement, or other smaller construct. The set of filters applied
to any given construct must not conflict, but they can be overridden by
filters on other constructs nested within it. A front end can use a
DiagnosticFilterMap
to collect the filters applied to a single construct,
using the add
method’s error checking to forbid conflicts.
For each filter it contains, a DiagnosticFilterMap
records the requested
severity, and the source span of the filter itself.
Tuple Fields§
§0: IndexMap<FilterableTriggeringRule, (Severity, Span)>
Implementations§
source§impl DiagnosticFilterMap
impl DiagnosticFilterMap
pub(crate) fn new() -> Self
sourcepub(crate) fn add(
&mut self,
diagnostic_filter: DiagnosticFilter,
span: Span,
should_conflict_on_full_duplicate: ShouldConflictOnFullDuplicate,
) -> Result<(), ConflictingDiagnosticRuleError>
pub(crate) fn add( &mut self, diagnostic_filter: DiagnosticFilter, span: Span, should_conflict_on_full_duplicate: ShouldConflictOnFullDuplicate, ) -> Result<(), ConflictingDiagnosticRuleError>
Add the given diagnostic_filter
parsed at the given span
to this map.
Trait Implementations§
source§impl Clone for DiagnosticFilterMap
impl Clone for DiagnosticFilterMap
source§fn clone(&self) -> DiagnosticFilterMap
fn clone(&self) -> DiagnosticFilterMap
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DiagnosticFilterMap
impl Debug for DiagnosticFilterMap
source§impl Default for DiagnosticFilterMap
impl Default for DiagnosticFilterMap
source§fn default() -> DiagnosticFilterMap
fn default() -> DiagnosticFilterMap
source§impl IntoIterator for DiagnosticFilterMap
impl IntoIterator for DiagnosticFilterMap
Auto Trait Implementations§
impl Freeze for DiagnosticFilterMap
impl RefUnwindSafe for DiagnosticFilterMap
impl Send for DiagnosticFilterMap
impl Sync for DiagnosticFilterMap
impl Unpin for DiagnosticFilterMap
impl UnwindSafe for DiagnosticFilterMap
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)