diff --git a/src/librustc/back/abi.rs b/src/librustc/back/abi.rs
index 945ee645414b7..8f639a5e499f1 100644
--- a/src/librustc/back/abi.rs
+++ b/src/librustc/back/abi.rs
@@ -45,9 +45,8 @@ pub static tydesc_field_align: uint = 1u;
pub static tydesc_field_take_glue: uint = 2u;
pub static tydesc_field_drop_glue: uint = 3u;
pub static tydesc_field_visit_glue: uint = 4u;
-pub static tydesc_field_borrow_offset: uint = 5u;
-pub static tydesc_field_name_offset: uint = 6u;
-pub static n_tydesc_fields: uint = 7u;
+pub static tydesc_field_name_offset: uint = 5u;
+pub static n_tydesc_fields: uint = 6u;
// The two halves of a closure: code and environment.
pub static fn_field_code: uint = 0u;
diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs
index aa2bd656b9091..a7924946ed185 100644
--- a/src/librustc/middle/trans/_match.rs
+++ b/src/librustc/middle/trans/_match.rs
@@ -1584,14 +1584,9 @@ fn compile_submatch_continue<'r,
}
if any_uniq_pat(m, col) {
- let pat_ty = node_id_type(bcx, pat_id);
let llbox = Load(bcx, val);
- let unboxed = match ty::get(pat_ty).sty {
- ty::ty_uniq(..) if !ty::type_contents(bcx.tcx(), pat_ty).owns_managed() => llbox,
- _ => GEPi(bcx, llbox, [0u, abi::box_field_body])
- };
compile_submatch(bcx, enter_uniq(bcx, dm, m, col, val),
- vec::append(~[unboxed], vals_left), chk);
+ vec::append(~[llbox], vals_left), chk);
return;
}
@@ -2231,13 +2226,8 @@ fn bind_irrefutable_pat<'a>(
}
}
ast::PatUniq(inner) => {
- let pat_ty = node_id_type(bcx, pat.id);
let llbox = Load(bcx, val);
- let unboxed = match ty::get(pat_ty).sty {
- ty::ty_uniq(..) if !ty::type_contents(bcx.tcx(), pat_ty).owns_managed() => llbox,
- _ => GEPi(bcx, llbox, [0u, abi::box_field_body])
- };
- bcx = bind_irrefutable_pat(bcx, inner, unboxed, binding_mode);
+ bcx = bind_irrefutable_pat(bcx, inner, llbox, binding_mode);
}
ast::PatRegion(inner) => {
let loaded_val = Load(bcx, val);
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index 5e189bb2ab231..a7e5dfcf67b68 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -358,7 +358,7 @@ pub fn malloc_raw_dyn<'a>(
} else {
// we treat ~fn, @fn and @[] as @ here, which isn't ideal
let langcall = match heap {
- heap_managed | heap_managed_unique => {
+ heap_managed => {
require_alloc_fn(bcx, t, MallocFnLangItem)
}
heap_exchange_closure => {
@@ -382,9 +382,7 @@ pub fn malloc_raw_dyn<'a>(
langcall,
[tydesc, size],
None);
- let r = rslt(r.bcx, PointerCast(r.bcx, r.val, llty));
- maybe_set_managed_unique_rc(r.bcx, r.val, heap);
- r
+ rslt(r.bcx, PointerCast(r.bcx, r.val, llty))
}
}
@@ -431,27 +429,6 @@ pub fn malloc_general<'a>(bcx: &'a Block, t: ty::t, heap: heap)
malloc_general_dyn(bcx, t, heap, llsize_of(bcx.ccx(), ty))
}
-pub fn heap_for_unique(bcx: &Block, t: ty::t) -> heap {
- if ty::type_contents(bcx.tcx(), t).owns_managed() {
- heap_managed_unique
- } else {
- heap_exchange
- }
-}
-
-pub fn maybe_set_managed_unique_rc(bcx: &Block, bx: ValueRef, heap: heap) {
- assert!(heap != heap_exchange);
- if heap == heap_managed_unique {
- // In cases where we are looking at a unique-typed allocation in the
- // managed heap (thus have refcount 1 from the managed allocator),
- // such as a ~(@foo) or such. These need to have their refcount forced
- // to -2 so the annihilator ignores them.
- let rc = GEPi(bcx, bx, [0u, abi::box_field_refcnt]);
- let rc_val = C_int(bcx.ccx(), -2);
- Store(bcx, rc_val, rc);
- }
-}
-
// Type descriptor and type glue stuff
pub fn get_tydesc_simple(ccx: &CrateContext, t: ty::t) -> ValueRef {
diff --git a/src/librustc/middle/trans/closure.rs b/src/librustc/middle/trans/closure.rs
index d371637e1a76c..f3d061f70b150 100644
--- a/src/librustc/middle/trans/closure.rs
+++ b/src/librustc/middle/trans/closure.rs
@@ -150,14 +150,6 @@ pub fn mk_closure_tys(tcx: ty::ctxt,
return cdata_ty;
}
-fn heap_for_unique_closure(bcx: &Block, t: ty::t) -> heap {
- if ty::type_contents(bcx.tcx(), t).owns_managed() {
- heap_managed_unique
- } else {
- heap_exchange_closure
- }
-}
-
pub fn allocate_cbox<'a>(
bcx: &'a Block<'a>,
sigil: ast::Sigil,
@@ -173,7 +165,7 @@ pub fn allocate_cbox<'a>(
tcx.sess.bug("trying to trans allocation of @fn")
}
ast::OwnedSigil => {
- malloc_raw(bcx, cdata_ty, heap_for_unique_closure(bcx, cdata_ty))
+ malloc_raw(bcx, cdata_ty, heap_exchange_closure)
}
ast::BorrowedSigil => {
let cbox_ty = tuplify_box_ty(tcx, cdata_ty);
diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs
index 7f6ab2dd9d154..f98fec7cbef30 100644
--- a/src/librustc/middle/trans/common.rs
+++ b/src/librustc/middle/trans/common.rs
@@ -90,7 +90,6 @@ pub struct tydesc_info {
tydesc: ValueRef,
size: ValueRef,
align: ValueRef,
- borrow_offset: ValueRef,
name: ValueRef,
take_glue: Cell