Skip to content

unused_extern_crates: does not handle renamed crates used in other modules #57421

Closed
@ehuss

Description

@ehuss

The following suggests removing the extern crate which results in broken code.

#![warn(unused_extern_crates)]

extern crate time as time_crate;

pub mod m {
    pub use time_crate::Duration;
}

The following is also very similar:

#![warn(unused_extern_crates)]

extern crate time as time_crate;

pub mod m {
    use time_crate::Duration;
    pub fn f() {
        Duration::days(1);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions