diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 0fcac5aab62..6bd035f32bb 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -699,13 +699,12 @@ fn build_reduced_graph_for_item(&mut self, item: &'b Item) { } // These items live in the type namespace. - ItemKind::TyAlias(..) => { - let res = Res::Def(DefKind::TyAlias, self.r.definitions.local_def_id(item.id)); - self.r.define(parent, ident, TypeNS, (res, vis, sp, expansion)); - } - - ItemKind::OpaqueTy(_, _) => { - let res = Res::Def(DefKind::OpaqueTy, self.r.definitions.local_def_id(item.id)); + ItemKind::TyAlias(ref ty, _) => { + let def_kind = match ty.kind.opaque_top_hack() { + None => DefKind::TyAlias, + Some(_) => DefKind::OpaqueTy, + }; + let res = Res::Def(def_kind, self.r.definitions.local_def_id(item.id)); self.r.define(parent, ident, TypeNS, (res, vis, sp, expansion)); } diff --git a/src/librustc_resolve/late.rs b/src/librustc_resolve/late.rs index 3340566a875..1316f8d8aa1 100644 --- a/src/librustc_resolve/late.rs +++ b/src/librustc_resolve/late.rs @@ -730,7 +730,6 @@ fn resolve_item(&mut self, item: &Item) { match item.kind { ItemKind::TyAlias(_, ref generics) | - ItemKind::OpaqueTy(_, ref generics) | ItemKind::Fn(_, ref generics, _) => { self.with_generic_param_rib(generics, ItemRibKind(HasGenericParams::Yes), |this| visit::walk_item(this, item)); @@ -1085,18 +1084,6 @@ fn resolve_implementation(&mut self, this.visit_ty(ty); } - ImplItemKind::OpaqueTy(ref bounds) => { - // If this is a trait impl, ensure the type - // exists in trait - this.check_trait_item(impl_item.ident, - TypeNS, - impl_item.span, - |n, s| TypeNotMemberOfTrait(n, s)); - - for bound in bounds { - this.visit_param_bound(bound); - } - } ImplItemKind::Macro(_) => panic!("unexpanded macro in resolve!"), }