remove reference counting headers from ~

Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.

This `{ ref_count, type_desc, prev, next }` header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
has been left out.

The `borrow_offset` field can now be removed from `TyDesc` along with
the associated handling in the compiler.

Closes #9510
Closes #11533
This commit is contained in:
Daniel Micay
2014-01-14 02:46:58 -05:00
parent 9075025c7b
commit 0e885e42b1
22 changed files with 152 additions and 148 deletions

View File

@@ -230,4 +230,12 @@ mod tests {
drop(x);
assert!(y.upgrade().is_none());
}
#[test]
fn gc_inside() {
// see issue #11532
use gc::Gc;
let a = Rc::new(RefCell::new(Gc::new(1)));
assert!(a.borrow().try_borrow_mut().is_some());
}
}