From 959e3823771ce0a58214c4547861d4f5a4a76ed8 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 1 Feb 2013 00:17:56 -0800 Subject: [PATCH] Revert "DO NOT COMMIT" This reverts commit 76679c1f91fc68134c850b2d77ff2b83b32a108f. --- src/librustc/middle/trans/glue.rs | 21 --------------------- src/librustc/middle/ty.rs | 3 +-- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index 50aa478b74b..4e557082e61 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -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 | diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 48e6a3145f0..b07e3ef7b81 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -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"); } };