Skip to content

unused-extern-crate false positive with sysroot crates #69304

Closed
@nagisa

Description

@nagisa

To use certain crates such as proc_macro it is required to include it with extern crate proc_macro. Similar thing applies to other sysroot crates.

Denying the unused group of lints will prevent code from compiling properly with an error like this:

error: `extern crate` is not idiomatic in the new edition
 --> src/lib.rs:3:1
  |
3 | extern crate proc_macro;
  | ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `use`
  |
  = note: `-D unused-extern-crates` implied by `-D unused`

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-bugCategory: This is a bug.T-cargoRelevant to the cargo 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