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

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

Closed
ehuss opened this issue Jan 7, 2019 · 1 comment
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`

Comments

@ehuss
Copy link
Contributor

ehuss commented Jan 7, 2019

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.

@ehuss
Copy link
Contributor Author

ehuss commented Jun 22, 2019

This was fixed by #57557. @petrochenkov, if you're satisfied that the existing tests cover this, feel free to close this issue. extern-crate-used.rs from that PR seems to be the closest existing test, which seems pretty close to the same as this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`
Projects
None yet
Development

No branches or pull requests

3 participants