Silence unused_imports lint for redundant imports

This commit is contained in:
Michael Goulet 2024-04-11 13:32:17 -04:00
parent 72fe8a0f00
commit 0db2a4010a
26 changed files with 43 additions and 275 deletions

View file

@ -1391,6 +1391,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let mut redundant_spans: Vec<_> = redundant_span.present_items().collect();
redundant_spans.sort();
redundant_spans.dedup();
/* FIXME(unused_imports): Add this back as a new lint
self.lint_buffer.buffer_lint_with_diagnostic(
UNUSED_IMPORTS,
id,
@ -1398,6 +1399,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
format!("the item `{source}` is imported redundantly"),
BuiltinLintDiag::RedundantImport(redundant_spans, source),
);
*/
return true;
}

View file

@ -177,7 +177,7 @@ enum ImplTraitContext {
/// Used for tracking import use types which will be used for redundant import checking.
/// ### Used::Scope Example
/// ```rust,compile_fail
/// ```rust,ignore (redundant_imports)
/// #![deny(unused_imports)]
/// use std::mem::drop;
/// fn main() {