mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
Remove duplicated redundant spans
This commit is contained in:
parent
96d700f1b7
commit
fd4c6e903b
@ -1310,15 +1310,14 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
|
||||
if !is_redundant.is_empty() &&
|
||||
is_redundant.present_items().all(|is_redundant| is_redundant)
|
||||
{
|
||||
let mut redundant_spans: Vec<_> = redundant_span.present_items().collect();
|
||||
redundant_spans.dedup();
|
||||
self.session.buffer_lint_with_diagnostic(
|
||||
UNUSED_IMPORTS,
|
||||
directive.id,
|
||||
directive.span,
|
||||
&format!("the item `{}` is imported redundantly", ident),
|
||||
BuiltinLintDiagnostics::RedundantImport(
|
||||
redundant_span.present_items().collect(),
|
||||
ident,
|
||||
),
|
||||
BuiltinLintDiagnostics::RedundantImport(redundant_spans, ident),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user