Skip to content

Commit 37abcda

Browse files
committed
rustc: Make type_is_pod class-aware
1 parent 7f45ba4 commit 37abcda

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rustc/middle/ty.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,13 @@ fn type_is_pod(cx: ctxt, ty: t) -> bool {
16861686
ty_constr(subt, _) { result = type_is_pod(cx, subt); }
16871687
ty_param(_, _) { result = false; }
16881688
ty_opaque_closure_ptr(_) { result = true; }
1689+
ty_class(did, substs) {
1690+
result = vec::any(lookup_class_fields(cx, did)) { |f|
1691+
let fty = ty::lookup_item_type(cx, f.id);
1692+
let sty = subst(cx, substs, fty.ty);
1693+
type_is_pod(cx, sty)
1694+
};
1695+
}
16891696
_ { cx.sess.bug("unexpected type in type_is_pod"); }
16901697
}
16911698

0 commit comments

Comments
 (0)