Skip to content

Missed unused import in 2018 edition when importing a crate #53741

Open
@alexcrichton

Description

@alexcrichton

Code like this:

fn main() {
    test1::foo();
    test2::foo();
}

mod test1 {
    use std;
    
    pub fn foo() {
        std::mem::drop(3);
    }
}

mod test2 {
    use std;
    
    pub fn foo() {
        std::println!("x");
    }
}

when compiled yields no warnings currently. In theory, though, both imports of std are unused due to the 2018 crate prelude!

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-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions