Skip to content

Lint against imports that are dead code #80443

Closed
@CryZe

Description

@CryZe

I'm very often seeing people write imports such as this one:
use regex;

Such an import is almost always dead code, because ever since Rust 2018 all external crates are already in scope. In fact pretty much any import that doesn't contain at least one of pub, as ... or :: is very likely dead code. Rust does not currently emit any warning for such an import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions