Skip to content

unused_extern_crates: suggests removing sysroot crate when used inside a submodule #57424

Closed
@ehuss

Description

@ehuss

The following gives a suggestion to remove the extern crate which results in broken code in 2018.

#![warn(unused_extern_crates)]

extern crate proc_macro;  // suggests removing this which is incorrect.

pub mod m {
    pub fn f(_ts: proc_macro::TokenStream) {
    }
}

The lint doesn't fire if the crate is used in the root module.

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