1
Fork 0

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:
Aaron Hill 2022-01-23 17:05:48 -05:00
parent bfe1564676
commit 58d676b0cc
No known key found for this signature in database
GPG key ID: B4087E510E98B164
22 changed files with 382 additions and 26 deletions

View file

@ -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(