Skip to content

Commit ad28c28

Browse files
committed
Stop treating a type alias like a module or enum (preventing use TypeAlias::*)
1 parent 8b7c3f2 commit ad28c28

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc_resolve/build_reduced_graph.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,8 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
331331

332332
// These items live in the type namespace.
333333
ItemTy(..) => {
334-
let parent_link = ModuleParentLink(parent, name);
335334
let def = Def::TyAlias(self.ast_map.local_def_id(item.id));
336-
let module = self.new_module(parent_link, Some(def), false, is_public);
337-
self.define(parent, name, TypeNS, (module, sp));
335+
self.define(parent, name, TypeNS, (def, sp, modifiers));
338336
parent
339337
}
340338

@@ -505,7 +503,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
505503
}
506504

507505
match def {
508-
Def::Mod(_) | Def::ForeignMod(_) | Def::Enum(..) | Def::TyAlias(..) => {
506+
Def::Mod(_) | Def::ForeignMod(_) | Def::Enum(..) => {
509507
debug!("(building reduced graph for external crate) building module {} {}",
510508
final_ident,
511509
is_public);
@@ -562,7 +560,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
562560
let module = self.new_module(parent_link, Some(def), true, is_public);
563561
self.try_define(new_parent, name, TypeNS, (module, DUMMY_SP));
564562
}
565-
Def::AssociatedTy(..) => {
563+
Def::TyAlias(..) | Def::AssociatedTy(..) => {
566564
debug!("(building reduced graph for external crate) building type {}",
567565
final_ident);
568566
self.try_define(new_parent, name, TypeNS, (def, DUMMY_SP, modifiers));

0 commit comments

Comments
 (0)