@@ -888,9 +888,11 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
888888 PathResult :: Indeterminate | PathResult :: NonModule ( ..) => unreachable ! ( ) ,
889889 } ;
890890
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) ,
894896 GlobImport { is_prelude, ref max_vis } => {
895897 if directive. module_path . len ( ) <= 1 {
896898 // 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> {
944946 // Consistency checks, analogous to `finalize_current_module_macro_resolutions`.
945947 let initial_def = source_bindings[ ns] . get ( ) . map ( |initial_binding| {
946948 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+ }
949953 initial_binding. def_ignoring_ambiguity ( )
950954 } ) ;
951955 let def = binding. def_ignoring_ambiguity ( ) ;
0 commit comments