summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-15 18:18:00 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-06-11 09:11:40 -0700
commit531ed3d599000de2517cba102c83fe44a1f1e252 (patch)
treef6da0ce70539e996d6a533f78e699ab1434a9ede /src/liballoc
parentea41101b3522f2a7d121758be489404cbb0fde5a (diff)
downloadrust-531ed3d599000de2517cba102c83fe44a1f1e252.tar.gz
rust-531ed3d599000de2517cba102c83fe44a1f1e252.zip
rustc: Update how Gc<T> is recognized
This commit uses the same trick as ~/Box to map Gc<T> to @T internally inside
the compiler. This moves a number of implementations of traits to the `gc`
module in the standard library.

This removes functions such as `Gc::new`, `Gc::borrow`, and `Gc::ptr_eq` in
favor of the more modern equivalents, `box(GC)`, `Deref`, and pointer equality.

The Gc pointer itself should be much more useful now, and subsequent commits
will move the compiler away from @T towards Gc<T>

[breaking-change]
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/rc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 416a6ad2d8b..8b28ab917b3 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -320,8 +320,8 @@ mod tests {
     #[test]
     fn gc_inside() {
         // see issue #11532
-        use std::gc::Gc;
-        let a = Rc::new(RefCell::new(Gc::new(1)));
+        use realstd::gc::Gc;
+        let a = Rc::new(RefCell::new(box(GC) 1));
         assert!(a.try_borrow_mut().is_some());
     }