Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TAIT: adjust resolve
  • Loading branch information
Centril committed Nov 14, 2019
1 parent 89b5907 commit 75aaa85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
13 changes: 6 additions & 7 deletions src/librustc_resolve/build_reduced_graph.rs
Expand Up @@ -699,13 +699,12 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
}

// 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));
}

Expand Down
13 changes: 0 additions & 13 deletions src/librustc_resolve/late.rs
Expand Up @@ -730,7 +730,6 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {

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));
Expand Down Expand Up @@ -1085,18 +1084,6 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {

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!"),
}
Expand Down

0 comments on commit 75aaa85

Please sign in to comment.