Skip to content

Commit 75aaa85

Browse files
committed
TAIT: adjust resolve
1 parent 89b5907 commit 75aaa85

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

src/librustc_resolve/build_reduced_graph.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,12 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
699699
}
700700

701701
// These items live in the type namespace.
702-
ItemKind::TyAlias(..) => {
703-
let res = Res::Def(DefKind::TyAlias, self.r.definitions.local_def_id(item.id));
704-
self.r.define(parent, ident, TypeNS, (res, vis, sp, expansion));
705-
}
706-
707-
ItemKind::OpaqueTy(_, _) => {
708-
let res = Res::Def(DefKind::OpaqueTy, self.r.definitions.local_def_id(item.id));
702+
ItemKind::TyAlias(ref ty, _) => {
703+
let def_kind = match ty.kind.opaque_top_hack() {
704+
None => DefKind::TyAlias,
705+
Some(_) => DefKind::OpaqueTy,
706+
};
707+
let res = Res::Def(def_kind, self.r.definitions.local_def_id(item.id));
709708
self.r.define(parent, ident, TypeNS, (res, vis, sp, expansion));
710709
}
711710

src/librustc_resolve/late.rs

-13
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
730730

731731
match item.kind {
732732
ItemKind::TyAlias(_, ref generics) |
733-
ItemKind::OpaqueTy(_, ref generics) |
734733
ItemKind::Fn(_, ref generics, _) => {
735734
self.with_generic_param_rib(generics, ItemRibKind(HasGenericParams::Yes),
736735
|this| visit::walk_item(this, item));
@@ -1085,18 +1084,6 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
10851084

10861085
this.visit_ty(ty);
10871086
}
1088-
ImplItemKind::OpaqueTy(ref bounds) => {
1089-
// If this is a trait impl, ensure the type
1090-
// exists in trait
1091-
this.check_trait_item(impl_item.ident,
1092-
TypeNS,
1093-
impl_item.span,
1094-
|n, s| TypeNotMemberOfTrait(n, s));
1095-
1096-
for bound in bounds {
1097-
this.visit_param_bound(bound);
1098-
}
1099-
}
11001087
ImplItemKind::Macro(_) =>
11011088
panic!("unexpanded macro in resolve!"),
11021089
}

0 commit comments

Comments
 (0)