@@ -888,9 +888,11 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
888
888
PathResult :: Indeterminate | PathResult :: NonModule ( ..) => unreachable ! ( ) ,
889
889
} ;
890
890
891
- let ( ident, source_bindings, target_bindings, type_ns_only) = match directive. subclass {
892
- SingleImport { source, ref source_bindings, ref target_bindings, type_ns_only, .. } =>
893
- ( source, source_bindings, target_bindings, type_ns_only) ,
891
+ let ( ident, target, source_bindings, target_bindings, type_ns_only) =
892
+ match directive. subclass {
893
+ SingleImport { source, target, ref source_bindings,
894
+ ref target_bindings, type_ns_only } =>
895
+ ( source, target, source_bindings, target_bindings, type_ns_only) ,
894
896
GlobImport { is_prelude, ref max_vis } => {
895
897
if directive. module_path . len ( ) <= 1 {
896
898
// HACK(eddyb) `lint_if_path_starts_with_module` needs at least
@@ -944,8 +946,10 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
944
946
// Consistency checks, analogous to `finalize_current_module_macro_resolutions`.
945
947
let initial_def = source_bindings[ ns] . get ( ) . map ( |initial_binding| {
946
948
all_ns_err = false ;
947
- this. record_use ( ident, ns, initial_binding,
948
- directive. module_path . is_empty ( ) ) ;
949
+ if target. name == "_" &&
950
+ initial_binding. is_extern_crate ( ) && !initial_binding. is_import ( ) {
951
+ this. used_imports . insert ( ( directive. id , TypeNS ) ) ;
952
+ }
949
953
initial_binding. def_ignoring_ambiguity ( )
950
954
} ) ;
951
955
let def = binding. def_ignoring_ambiguity ( ) ;
0 commit comments