Avoid false positive unused_extern_crates.

This commit is contained in:
Jeffrey Seyfried 2016-10-23 05:05:24 +00:00
parent 04ca378b89
commit 0d30325286
2 changed files with 3 additions and 0 deletions

View File

@ -513,6 +513,7 @@ fn import_extern_crate_macros(&mut self,
legacy_imports: LegacyMacroImports,
allow_shadowing: bool) {
let import_macro = |this: &mut Self, name, ext: Rc<_>, span| {
this.used_crates.insert(module.def_id().unwrap().krate);
if let SyntaxExtension::NormalTT(..) = *ext {
this.macro_names.insert(name);
}

View File

@ -26,6 +26,8 @@
extern crate lint_unused_extern_crate as other; // no error, the use * marks it as used
#[macro_use] extern crate core; // no error, the `#[macro_use]` marks it as used
#[allow(unused_imports)]
use rand::isaac::IsaacRng;