Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2018 lints: false positive: "extern crate is not idiomatic" #52479

Closed
matthiaskrgr opened this issue Jul 18, 2018 · 1 comment
Closed

2018 lints: false positive: "extern crate is not idiomatic" #52479

matthiaskrgr opened this issue Jul 18, 2018 · 1 comment
Labels
A-edition-2018-lints Area: Lints supporting the 2018 edition

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jul 18, 2018

git clone http://github.com/matthiaskrgr/cargo-rebuild-check
cd cargo-rebuild-check/
git checkout origin/rust_2018
cargo test

=>

   Compiling cargo-rebuild-check v0.1.0 (file:///tmp/cargo-rebuild-check)
warning: `extern crate` is not idiomatic in the new edition========> ] 134/135: cargo-rebuild-check
  |
note: lint level defined here
 --> src/main.rs:11:5
  |
11|     unused
  |     ^^^^^^
  = note: #[warn(unused_extern_crates)] implied by #[warn(unused)]
    Finished dev [unoptimized + debuginfo] target(s) in 1m 24s
     Running target/debug/deps/cargo_rebuild_check-49c258c37ade7bcc

I'm not sure what rustc is complaining about.
There simply is no "extern crate" inside the project at this point :/
It also fails to point me to the code location which is suspicious.

rustc 1.29.0-nightly (4f3c7a4 2018-07-17)

@alexcrichton
Copy link
Member

I've confirmed this is fixed by #52467

@alexcrichton alexcrichton added this to the Rust 2018 Preview 2 milestone Jul 18, 2018
bors added a commit that referenced this issue Jul 20, 2018
Squash all lints tied to foreign macros by default

This PR is a continuation of #49755 (thanks for the initial jump-start @Dylan-DPC!) and is targeted at solving #48855. This change updates the lint infrastructure to, by default, ignore all lints emitted for code that originates in a foreign macro. For example if `println!("...")` injects some idiomatic warnings these are all ignored by default. The rationale here is that for almost all lints there's no action that can be taken if the code originates from a foreign lint.

Closes #48855
Closes #52483
Closes #52479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2018-lints Area: Lints supporting the 2018 edition
Projects
None yet
Development

No branches or pull requests

2 participants