pub struct IssueBuffer { /* private fields */ }Implementations§
Source§impl IssueBuffer
impl IssueBuffer
pub fn new() -> Self
pub fn add(&mut self, issue: Issue)
pub fn add_suppression(&mut self, name: impl Into<String>)
Sourcepub fn into_issues(self) -> Vec<Issue>
pub fn into_issues(self) -> Vec<Issue>
Consume the buffer and return unsuppressed issues.
Sourcepub fn into_all_issues(self) -> Vec<Issue>
pub fn into_all_issues(self) -> Vec<Issue>
Like into_issues but keeps suppressed issues (with suppressed = true)
so callers that need to detect unused suppressions can see which issues
were silenced. File-level suppressions are also marked suppressed = true
rather than dropped.
Sourcepub fn suppress_range(&mut self, from: usize, suppressions: &[String])
pub fn suppress_range(&mut self, from: usize, suppressions: &[String])
Mark all issues added since index from as suppressed if their issue
name appears in suppressions. Used for @psalm-suppress / @suppress on statements.
Sourcepub fn issue_count(&self) -> usize
pub fn issue_count(&self) -> usize
Current number of buffered issues. Use before analyzing a statement to
get the from index for suppress_range.
Sourcepub fn truncate_to(&mut self, mark: usize)
pub fn truncate_to(&mut self, mark: usize)
Discard every issue added since index mark, un-marking their
locations as seen so a later add() at the same spot isn’t silently
deduplicated away. Used to roll back a speculative analysis pass (e.g.
an unstabilized loop fixed-point iteration) whose diagnostics were
provisional and must not leak into the final result.