Skip to content

Commit

Permalink
Remove duplicated redundant spans
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Apr 11, 2019
1 parent 96d700f commit fd4c6e9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}
}
Expand Down

0 comments on commit fd4c6e9

Please sign in to comment.