Skip to content

Latest rustc tags unused_imports on trait imports spuriously #145185

@TheBlueMatt

Description

@TheBlueMatt

Copying from rust-lang/rust-clippy#15442

Summary

I honestly can't make heads or tails of why, but rustc is generating an unused_imports warning on some traits imports, but if you remove the import the build fails in several places.

Reproducer

I honestly don't have a clue as to what the issue is here, so a minimal reproducer is hard.
lightningdevkit/rust-lightning#4000 removes the allows that were previously in place, see the last commit.

rustc stable
info: latest update on 2025-08-07, rust version 1.89.0 (29483883e 2025-08-04)

Metadata

Metadata

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.L-unused_importsLint: unused_importsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions