Skip to content

unused_extern_crates warns about extern crates that only supply macros #35081

New issue

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

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

Already on GitHub? # to your account

Closed
joshtriplett opened this issue Jul 28, 2016 · 1 comment
Closed

Comments

@joshtriplett
Copy link
Member

I ran into this when using quick_error. Minimal test case (along with a Cargo.toml including quick-error="*" in [dependencies]):

#![warn(unused_extern_crates)]

#[macro_use]
extern crate quick_error;

quick_error! {
    #[derive(Debug)]
    enum Error {
        Msg(msg: String) {
            from()
            from(s: &'static str) -> (s.to_string())
            description(msg)
            display("{}", msg)
        }
}

This produces:

src/main.rs:4:1: 4:26 warning: unused extern crate
src/main.rs:4 extern crate quick_error;
              ^~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:1:9: 1:29 note: lint level defined here
src/main.rs:1 #![warn(unused_extern_crates)]
                      ^~~~~~~~~~~~~~~~~~~~
@sanxiyn
Copy link
Member

sanxiyn commented Jul 28, 2016

Closing as a duplicate of #30849. Thanks!

@sanxiyn sanxiyn closed this as completed Jul 28, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants