mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
rustc: Make type_is_pod class-aware
This commit is contained in:
parent
7f45ba4744
commit
37abcda42b
@ -1686,6 +1686,13 @@ fn type_is_pod(cx: ctxt, ty: t) -> bool {
|
|||||||
ty_constr(subt, _) { result = type_is_pod(cx, subt); }
|
ty_constr(subt, _) { result = type_is_pod(cx, subt); }
|
||||||
ty_param(_, _) { result = false; }
|
ty_param(_, _) { result = false; }
|
||||||
ty_opaque_closure_ptr(_) { result = true; }
|
ty_opaque_closure_ptr(_) { result = true; }
|
||||||
|
ty_class(did, substs) {
|
||||||
|
result = vec::any(lookup_class_fields(cx, did)) { |f|
|
||||||
|
let fty = ty::lookup_item_type(cx, f.id);
|
||||||
|
let sty = subst(cx, substs, fty.ty);
|
||||||
|
type_is_pod(cx, sty)
|
||||||
|
};
|
||||||
|
}
|
||||||
_ { cx.sess.bug("unexpected type in type_is_pod"); }
|
_ { cx.sess.bug("unexpected type in type_is_pod"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user