]> git.lizzy.rs Git - rust.git/commitdiff
Stop treating a type alias like a module or enum (preventing `use TypeAlias::*`)
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Tue, 8 Mar 2016 21:50:01 +0000 (21:50 +0000)
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Tue, 8 Mar 2016 21:50:20 +0000 (21:50 +0000)
src/librustc_resolve/build_reduced_graph.rs

index b3d7be4775e42ae81d84549ed3ecd3161df4a075..e1eead8547e82cef8d372f2a64584f80d7437b1f 100644 (file)
@@ -331,10 +331,8 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: Module<'b>) -> M
 
             // These items live in the type namespace.
             ItemTy(..) => {
-                let parent_link = ModuleParentLink(parent, name);
                 let def = Def::TyAlias(self.ast_map.local_def_id(item.id));
-                let module = self.new_module(parent_link, Some(def), false, is_public);
-                self.define(parent, name, TypeNS, (module, sp));
+                self.define(parent, name, TypeNS, (def, sp, modifiers));
                 parent
             }
 
@@ -505,7 +503,7 @@ fn handle_external_def(&mut self,
         }
 
         match def {
-            Def::Mod(_) | Def::ForeignMod(_) | Def::Enum(..) | Def::TyAlias(..) => {
+            Def::Mod(_) | Def::ForeignMod(_) | Def::Enum(..) => {
                 debug!("(building reduced graph for external crate) building module {} {}",
                        final_ident,
                        is_public);
@@ -562,7 +560,7 @@ fn handle_external_def(&mut self,
                 let module = self.new_module(parent_link, Some(def), true, is_public);
                 self.try_define(new_parent, name, TypeNS, (module, DUMMY_SP));
             }
-            Def::AssociatedTy(..) => {
+            Def::TyAlias(..) | Def::AssociatedTy(..) => {
                 debug!("(building reduced graph for external crate) building type {}",
                        final_ident);
                 self.try_define(new_parent, name, TypeNS, (def, DUMMY_SP, modifiers));