Skip to content

Warn about useless imports #68177

Closed
Closed
@CryZe

Description

@CryZe

I'm seeing quite a lot of people do the following:

use some_crate;

However due to uniform paths, this doesn't do anything, as the crate is already accessible like that in the current module. This neither disambiguates nor does it have any meaningful effect, yet Rust does not emit a warning.

All of this only applies to uniform paths. So in Rust 2015 this actually is a meaningful import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions