Revert "DO NOT COMMIT"

This reverts commit 76679c1f91.
This commit is contained in:
Brian Anderson 2013-02-01 00:17:56 -08:00
parent e30388f682
commit 959e382377
2 changed files with 1 additions and 23 deletions

View File

@ -571,30 +571,9 @@ pub fn decr_refcnt_maybe_free(bcx: block,
}
}
pub fn copy_glue_should_never_be_called(bcx: block, t: ty::t) -> bool {
match ty::get(t).sty {
ty::ty_infer(*)
| ty::ty_type
| ty::ty_opaque_closure_ptr(*)
| ty::ty_opaque_box
| ty::ty_unboxed_vec(*)
| ty::ty_err => {
// Not sure under what scenarios these non-types get take glue
false
}
_ => !ty::type_is_copyable(bcx.tcx(), t)
}
}
pub fn make_take_glue(bcx: block, v: ValueRef, t: ty::t) {
let _icx = bcx.insn_ctxt("make_take_glue");
if copy_glue_should_never_be_called(bcx, t) {
controlflow::trans_fail(bcx, bcx.fcx.span,
~"calling take glue on non-copyable");
return;
}
// NB: v is a *pointer* to type t here, not a direct value.
let bcx = match ty::get(t).sty {
ty::ty_box(_) | ty::ty_opaque_box |

View File

@ -2181,8 +2181,7 @@ pub fn type_kind_ext(cx: ctxt, ty: t, allow_ty_var: bool) -> Kind {
ty_type | ty_opaque_closure_ptr(_)
| ty_opaque_box | ty_unboxed_vec(_) | ty_err => {
kind_copyable()
//cx.sess.bug(~"Asked to compute kind of fictitious type");
cx.sess.bug(~"Asked to compute kind of fictitious type");
}
};