Skip to content

Commit 73b4f06

Browse files
committed
suppress duplicate lints
1 parent f69eb8e commit 73b4f06

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc/session/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ impl Session {
246246
let lint_id = lint::LintId::of(lint);
247247
let mut lints = self.lints.borrow_mut();
248248
match lints.get_mut(&id) {
249-
Some(arr) => { arr.push((lint_id, sp, msg)); return; }
249+
Some(arr) => {
250+
let tuple = (lint_id, sp, msg);
251+
if !arr.contains(&tuple) {
252+
arr.push(tuple);
253+
}
254+
return;
255+
}
250256
None => {}
251257
}
252258
lints.insert(id, vec!((lint_id, sp, msg)));

0 commit comments

Comments
 (0)