TAIT: adjust resolve

This commit is contained in:
Mazdak Farrokhzad 2019-11-07 19:39:21 +01:00
parent 89b5907357
commit 75aaa85f46
2 changed files with 6 additions and 20 deletions

View File

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

View File

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