Skip to content

Commit 32e448e

Browse files
committed
Change subtypes_require to handle class fields correctly
1 parent a5c9e8d commit 32e448e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/rustc/middle/ty.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,11 +1678,8 @@ fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
16781678

16791679
ty_class(did, substs) {
16801680
vec::push(*seen, did);
1681-
let r = vec::any(lookup_class_fields(cx, did)) {|f|
1682-
let fty = ty::lookup_item_type(cx, f.id);
1683-
let sty = subst(cx, substs, fty.ty);
1684-
type_requires(cx, seen, r_ty, sty)
1685-
};
1681+
let r = vec::any(class_items_as_fields(cx, did, substs)) {|f|
1682+
type_requires(cx, seen, r_ty, f.mt.ty)};
16861683
vec::pop(*seen);
16871684
r
16881685
}

0 commit comments

Comments
 (0)