Skip to content

strange rust_2018_idioms warning on code comment in clippy codebase #51881

Open
@matthiaskrgr

Description

@matthiaskrgr
git clone http://github.com/rust-lang-nursery/rust-clippy/
cd rust-clippy
git checkout 656b26ea4f2b330ea5b9cb3cb38545587eac8f7f
cargo check --all-targets --all-features 

=>

....
warning: `extern crate` is not idiomatic in the new edition
 --> src/lib.rs:1:1
  |
1 | // error-pattern:cargo-clippy
  | ^ help: convert it to a `use`
  |
note: lint level defined here
 --> src/lib.rs:8:9
  |
8 | #![warn(rust_2018_idioms)]
  |         ^^^^^^^^^^^^^^^^
  = note: #[warn(unused_extern_crates)] implied by #[warn(rust_2018_idioms)]

this is confusing because the highlighted line is a code comment and seems unrelated to the extern crate keyword.

rustc 1.28.0-nightly (cd494c1 2018-06-27)

link to file: https://github.com/rust-lang-nursery/rust-clippy/blob/656b26ea4f2b330ea5b9cb3cb38545587eac8f7f/src/lib.rs

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.F-rust_2018_preview`#![feature(rust_2018_preview)]`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