Remove deduplication of early lints
We already have a general mechanism for deduplicating reported lints, so there's no need to have an additional one for early lints specifically. This allows us to remove some `PartialEq` impls.
This commit is contained in:
parent
bfe1564676
commit
58d676b0cc
22 changed files with 382 additions and 26 deletions
|
@ -282,7 +282,7 @@ pub enum ExternDepSpec {
|
|||
|
||||
// This could be a closure, but then implementing derive trait
|
||||
// becomes hacky (and it gets allocated).
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive(Debug)]
|
||||
pub enum BuiltinLintDiagnostics {
|
||||
Normal,
|
||||
AbsPathWithModule(Span),
|
||||
|
@ -309,7 +309,6 @@ pub enum BuiltinLintDiagnostics {
|
|||
|
||||
/// Lints that are buffered up early on in the `Session` before the
|
||||
/// `LintLevels` is calculated.
|
||||
#[derive(PartialEq)]
|
||||
pub struct BufferedEarlyLint {
|
||||
/// The span of code that we are linting on.
|
||||
pub span: MultiSpan,
|
||||
|
@ -336,9 +335,7 @@ pub struct LintBuffer {
|
|||
impl LintBuffer {
|
||||
pub fn add_early_lint(&mut self, early_lint: BufferedEarlyLint) {
|
||||
let arr = self.map.entry(early_lint.node_id).or_default();
|
||||
if !arr.contains(&early_lint) {
|
||||
arr.push(early_lint);
|
||||
}
|
||||
arr.push(early_lint);
|
||||
}
|
||||
|
||||
pub fn add_lint(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue