suppress duplicate lints
This commit is contained in:
parent
f69eb8efbe
commit
73b4f06b83
1 changed files with 7 additions and 1 deletions
|
@ -246,7 +246,13 @@ impl Session {
|
|||
let lint_id = lint::LintId::of(lint);
|
||||
let mut lints = self.lints.borrow_mut();
|
||||
match lints.get_mut(&id) {
|
||||
Some(arr) => { arr.push((lint_id, sp, msg)); return; }
|
||||
Some(arr) => {
|
||||
let tuple = (lint_id, sp, msg);
|
||||
if !arr.contains(&tuple) {
|
||||
arr.push(tuple);
|
||||
}
|
||||
return;
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
lints.insert(id, vec!((lint_id, sp, msg)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue