Skip to content

Commit fd4c6e9

Browse files
committed
Remove duplicated redundant spans
1 parent 96d700f commit fd4c6e9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustc_resolve/resolve_imports.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,15 +1310,14 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
13101310
if !is_redundant.is_empty() &&
13111311
is_redundant.present_items().all(|is_redundant| is_redundant)
13121312
{
1313+
let mut redundant_spans: Vec<_> = redundant_span.present_items().collect();
1314+
redundant_spans.dedup();
13131315
self.session.buffer_lint_with_diagnostic(
13141316
UNUSED_IMPORTS,
13151317
directive.id,
13161318
directive.span,
13171319
&format!("the item `{}` is imported redundantly", ident),
1318-
BuiltinLintDiagnostics::RedundantImport(
1319-
redundant_span.present_items().collect(),
1320-
ident,
1321-
),
1320+
BuiltinLintDiagnostics::RedundantImport(redundant_spans, ident),
13221321
);
13231322
}
13241323
}

0 commit comments

Comments
 (0)