]> git.lizzy.rs Git - rust.git/commitdiff
tests: remove uses of Gc.
authorEduard Burtescu <edy.burt@gmail.com>
Thu, 2 Oct 2014 05:10:09 +0000 (08:10 +0300)
committerEduard Burtescu <edy.burt@gmail.com>
Thu, 2 Oct 2014 14:02:15 +0000 (17:02 +0300)
206 files changed:
src/liballoc/rc.rs
src/libcollections/ringbuf.rs
src/libcoretest/iter.rs
src/libdebug/repr.rs
src/librustrt/local_data.rs
src/librustrt/task.rs
src/test/auxiliary/cci_nested_lib.rs
src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
src/test/auxiliary/issue-2631-a.rs
src/test/auxiliary/issue-5521.rs
src/test/auxiliary/issue13507.rs
src/test/bench/task-perf-alloc-unwind.rs
src/test/compile-fail/autoderef-full-lval.rs
src/test/compile-fail/borrowck-borrow-immut-deref-of-gc-as-mut.rs [deleted file]
src/test/compile-fail/borrowck-managed-pointer-deref-scope.rs [deleted file]
src/test/compile-fail/borrowck-preserve-box-in-field.rs [deleted file]
src/test/compile-fail/borrowck-preserve-box-in-uniq.rs [deleted file]
src/test/compile-fail/borrowck-preserve-box.rs [deleted file]
src/test/compile-fail/borrowck-preserve-cond-box.rs [deleted file]
src/test/compile-fail/borrowck-preserve-expl-deref.rs [deleted file]
src/test/compile-fail/box-static-bound.rs [deleted file]
src/test/compile-fail/check-static-values-constraints.rs
src/test/compile-fail/core-tls-store-pointer.rs
src/test/compile-fail/issue-14915.rs
src/test/compile-fail/issue-2063-resource.rs
src/test/compile-fail/issue-3668.rs
src/test/compile-fail/issue-3763.rs
src/test/compile-fail/issue-7061.rs
src/test/compile-fail/issue-7364.rs
src/test/compile-fail/kindck-copy.rs
src/test/compile-fail/kindck-destructor-owned.rs
src/test/compile-fail/kindck-nonsendable-1.rs
src/test/compile-fail/lint-heap-memory.rs [deleted file]
src/test/compile-fail/lint-managed-heap-memory.rs [deleted file]
src/test/compile-fail/new-box-syntax-bad.rs [deleted file]
src/test/compile-fail/no-send-res-ports.rs
src/test/compile-fail/occurs-check-2.rs
src/test/compile-fail/occurs-check.rs
src/test/compile-fail/pinned-deep-copy.rs [deleted file]
src/test/compile-fail/regions-appearance-constraint.rs [deleted file]
src/test/compile-fail/regions-infer-borrow-scope-too-big.rs
src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs
src/test/compile-fail/regions-infer-paramd-indirect.rs
src/test/compile-fail/static-region-bound.rs
src/test/compile-fail/struct-field-assignability.rs
src/test/compile-fail/terr-sorts.rs
src/test/compile-fail/trait-impl-method-mismatch.rs
src/test/compile-fail/unique-unique-kind.rs
src/test/compile-fail/unique-vec-res.rs
src/test/compile-fail/unsendable-class.rs
src/test/debuginfo/borrowed-managed-basic.rs [deleted file]
src/test/debuginfo/borrowed-struct.rs
src/test/debuginfo/borrowed-tuple.rs
src/test/debuginfo/box.rs
src/test/debuginfo/boxed-struct.rs
src/test/debuginfo/by-value-self-argument-in-trait-impl.rs
src/test/debuginfo/managed-enum.rs [deleted file]
src/test/debuginfo/managed-pointer-within-unique-vec.rs [deleted file]
src/test/debuginfo/managed-pointer-within-unique.rs [deleted file]
src/test/debuginfo/recursive-struct.rs
src/test/debuginfo/var-captured-in-nested-closure.rs
src/test/debuginfo/var-captured-in-stack-closure.rs
src/test/pretty/block-disambig.rs
src/test/run-fail/args-fail.rs
src/test/run-fail/issue-2272.rs [deleted file]
src/test/run-fail/unwind-assert.rs [deleted file]
src/test/run-fail/unwind-box-fn-unique.rs [deleted file]
src/test/run-fail/unwind-box-res.rs [deleted file]
src/test/run-fail/unwind-box-str.rs [deleted file]
src/test/run-fail/unwind-box-unique-unique.rs [deleted file]
src/test/run-fail/unwind-box-unique.rs [deleted file]
src/test/run-fail/unwind-box-vec.rs [deleted file]
src/test/run-fail/unwind-box.rs [deleted file]
src/test/run-fail/unwind-fail.rs [deleted file]
src/test/run-fail/unwind-initializer-indirect.rs [deleted file]
src/test/run-fail/unwind-initializer.rs [deleted file]
src/test/run-fail/unwind-iter.rs [deleted file]
src/test/run-fail/unwind-iter2.rs [deleted file]
src/test/run-fail/unwind-lambda.rs [deleted file]
src/test/run-fail/unwind-match.rs [deleted file]
src/test/run-fail/unwind-misc-1.rs [deleted file]
src/test/run-fail/unwind-move.rs [deleted file]
src/test/run-fail/unwind-nested.rs [deleted file]
src/test/run-fail/unwind-partial-box.rs [deleted file]
src/test/run-fail/unwind-partial-unique.rs [deleted file]
src/test/run-fail/unwind-partial-vec.rs [deleted file]
src/test/run-fail/unwind-resource-fail.rs [deleted file]
src/test/run-fail/unwind-resource-fail2.rs [deleted file]
src/test/run-fail/unwind-resource-fail3.rs [deleted file]
src/test/run-fail/unwind-stacked.rs [deleted file]
src/test/run-fail/unwind-tup.rs [deleted file]
src/test/run-fail/unwind-tup2.rs [deleted file]
src/test/run-fail/unwind-uninitialized.rs [deleted file]
src/test/run-pass/assert-eq-macro-success.rs
src/test/run-pass/autoderef-method-priority.rs
src/test/run-pass/autoref-intermediate-types-issue-3585.rs
src/test/run-pass/binops.rs
src/test/run-pass/borrowck-borrow-from-expr-block.rs
src/test/run-pass/borrowck-preserve-box-in-moved-value.rs [deleted file]
src/test/run-pass/borrowck-root-while-cond-2.rs [deleted file]
src/test/run-pass/borrowck-root-while-cond.rs [deleted file]
src/test/run-pass/borrowck-univariant-enum.rs
src/test/run-pass/box-compare.rs [deleted file]
src/test/run-pass/box-in-tup.rs [deleted file]
src/test/run-pass/box-inside-if.rs [deleted file]
src/test/run-pass/box-inside-if2.rs [deleted file]
src/test/run-pass/box-pattern.rs [deleted file]
src/test/run-pass/box-unbox.rs [deleted file]
src/test/run-pass/box.rs [deleted file]
src/test/run-pass/boxed-class-type-substitution.rs [deleted file]
src/test/run-pass/cci_borrow.rs
src/test/run-pass/classes-self-referential.rs
src/test/run-pass/cleanup-copy-mode.rs [deleted file]
src/test/run-pass/crate-method-reexport-grrrrrrr.rs
src/test/run-pass/cycle-collection.rs [deleted file]
src/test/run-pass/deref-lval.rs
src/test/run-pass/deref.rs
src/test/run-pass/double-unbox.rs [deleted file]
src/test/run-pass/drop-on-empty-block-exit.rs
src/test/run-pass/enum-null-pointer-opt.rs
src/test/run-pass/enum-nullable-simplifycfg-misopt.rs
src/test/run-pass/evec-internal-boxes.rs [deleted file]
src/test/run-pass/export-non-interference.rs
src/test/run-pass/expr-block-box.rs [deleted file]
src/test/run-pass/expr-block-generic-box1.rs [deleted file]
src/test/run-pass/expr-block-generic-box2.rs [deleted file]
src/test/run-pass/expr-block-ref.rs [deleted file]
src/test/run-pass/expr-elseif-ref.rs [deleted file]
src/test/run-pass/expr-elseif-ref2.rs [deleted file]
src/test/run-pass/expr-if-box.rs [deleted file]
src/test/run-pass/expr-if-generic-box1.rs [deleted file]
src/test/run-pass/expr-if-generic-box2.rs [deleted file]
src/test/run-pass/expr-match-box.rs [deleted file]
src/test/run-pass/expr-match-generic-box1.rs [deleted file]
src/test/run-pass/expr-match-generic-box2.rs [deleted file]
src/test/run-pass/exterior.rs
src/test/run-pass/fail-during-tld-destroy.rs
src/test/run-pass/gc-vec.rs [deleted file]
src/test/run-pass/generic-alias-box.rs [deleted file]
src/test/run-pass/generic-box.rs [deleted file]
src/test/run-pass/generic-drop-glue.rs [deleted file]
src/test/run-pass/generic-exterior-box.rs [deleted file]
src/test/run-pass/generic-fn-box.rs [deleted file]
src/test/run-pass/generic-ivec.rs [deleted file]
src/test/run-pass/generic-recursive-tag.rs
src/test/run-pass/generic-tag.rs
src/test/run-pass/ifmt.rs
src/test/run-pass/init-res-into-things.rs
src/test/run-pass/issue-14082.rs
src/test/run-pass/issue-2631-b.rs
src/test/run-pass/issue-2708.rs
src/test/run-pass/issue-2735-2.rs
src/test/run-pass/issue-2735-3.rs
src/test/run-pass/issue-3012-2.rs
src/test/run-pass/issue-3121.rs
src/test/run-pass/issue-3447.rs
src/test/run-pass/issue-3556.rs
src/test/run-pass/issue-5884.rs
src/test/run-pass/issue-6117.rs
src/test/run-pass/issue-8898.rs
src/test/run-pass/issue-8983.rs [deleted file]
src/test/run-pass/issue-979.rs
src/test/run-pass/issue-980.rs [deleted file]
src/test/run-pass/leak-box-as-tydesc.rs [deleted file]
src/test/run-pass/leak-tag-copy.rs [deleted file]
src/test/run-pass/list.rs
src/test/run-pass/mlist.rs [deleted file]
src/test/run-pass/move-1.rs [deleted file]
src/test/run-pass/move-2.rs
src/test/run-pass/move-3.rs [deleted file]
src/test/run-pass/move-4.rs
src/test/run-pass/move-arg-2.rs
src/test/run-pass/mutable-vec-drop.rs [deleted file]
src/test/run-pass/mutual-recursion-group.rs
src/test/run-pass/new-box-syntax.rs
src/test/run-pass/newtype-struct-drop-run.rs
src/test/run-pass/nullable-pointer-iotareduction.rs
src/test/run-pass/nullable-pointer-size.rs
src/test/run-pass/objects-owned-object-borrowed-method-header.rs [deleted file]
src/test/run-pass/option-unwrap.rs
src/test/run-pass/output-slot-variants.rs
src/test/run-pass/packed-struct-size.rs
src/test/run-pass/packed-tuple-struct-size.rs
src/test/run-pass/pass-by-copy.rs [deleted file]
src/test/run-pass/rcvr-borrowed-to-region.rs
src/test/run-pass/regions-borrow-at.rs
src/test/run-pass/regions-escape-into-other-fn.rs
src/test/run-pass/regions-infer-borrow-scope-within-loop-ok.rs
src/test/run-pass/regions-infer-borrow-scope.rs
src/test/run-pass/resource-assign-is-not-copy.rs
src/test/run-pass/resource-destruct.rs
src/test/run-pass/resource-in-struct.rs
src/test/run-pass/shape_intrinsic_tag_then_rec.rs
src/test/run-pass/terminate-in-initializer.rs
src/test/run-pass/trait-cast.rs [deleted file]
src/test/run-pass/type-param-constraints.rs
src/test/run-pass/typeclasses-eq-example-static.rs
src/test/run-pass/typeclasses-eq-example.rs
src/test/run-pass/uniq-cc-generic.rs [deleted file]
src/test/run-pass/uniq-cc.rs [deleted file]
src/test/run-pass/unique-assign-generic.rs
src/test/run-pass/unwind-box.rs [deleted file]
src/test/run-pass/unwind-resource2.rs [deleted file]
src/test/run-pass/vec-drop.rs [deleted file]
src/test/run-pass/vec-slice-drop.rs
src/test/run-pass/weird-exprs.rs

index ec19844a24abd203d4358d668d190889d40d0928..049bf4eb1b02d2103e7ef1baf4ac85483ce794c9 100644 (file)
@@ -541,14 +541,6 @@ fn test_dead() {
         assert!(y.upgrade().is_none());
     }
 
-    #[test]
-    fn gc_inside() {
-        // see issue #11532
-        use std::gc::GC;
-        let a = Rc::new(RefCell::new(box(GC) 1i));
-        assert!(a.try_borrow_mut().is_some());
-    }
-
     #[test]
     fn weak_self_cyclic() {
         struct Cycle {
index 0e1c39535bed45e096665300c0c1409ceeb500d4..c9c824ac9cebff78a3bd16e7c58920fd796375d5 100644 (file)
@@ -532,7 +532,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 mod tests {
     use std::fmt::Show;
     use std::prelude::*;
-    use std::gc::{GC, Gc};
     use std::hash;
     use test::Bencher;
     use test;
@@ -587,43 +586,6 @@ fn test_simple() {
         assert_eq!(*d.get(3), 4);
     }
 
-    #[test]
-    #[allow(deprecated)]
-    fn test_boxes() {
-        let a: Gc<int> = box(GC) 5;
-        let b: Gc<int> = box(GC) 72;
-        let c: Gc<int> = box(GC) 64;
-        let d: Gc<int> = box(GC) 175;
-
-        let mut deq = RingBuf::new();
-        assert_eq!(deq.len(), 0);
-        deq.push_front(a);
-        deq.push_front(b);
-        deq.push(c);
-        assert_eq!(deq.len(), 3);
-        deq.push(d);
-        assert_eq!(deq.len(), 4);
-        assert_eq!(deq.front(), Some(&b));
-        assert_eq!(deq.back(), Some(&d));
-        assert_eq!(deq.pop_front(), Some(b));
-        assert_eq!(deq.pop(), Some(d));
-        assert_eq!(deq.pop(), Some(c));
-        assert_eq!(deq.pop(), Some(a));
-        assert_eq!(deq.len(), 0);
-        deq.push(c);
-        assert_eq!(deq.len(), 1);
-        deq.push_front(b);
-        assert_eq!(deq.len(), 2);
-        deq.push(d);
-        assert_eq!(deq.len(), 3);
-        deq.push_front(a);
-        assert_eq!(deq.len(), 4);
-        assert_eq!(*deq.get(0), a);
-        assert_eq!(*deq.get(1), b);
-        assert_eq!(*deq.get(2), c);
-        assert_eq!(*deq.get(3), d);
-    }
-
     #[cfg(test)]
     fn test_parameterized<T:Clone + PartialEq + Show>(a: T, b: T, c: T, d: T) {
         let mut deq = RingBuf::new();
@@ -755,12 +717,6 @@ fn test_param_int() {
         test_parameterized::<int>(5, 72, 64, 175);
     }
 
-    #[test]
-    fn test_param_at_int() {
-        test_parameterized::<Gc<int>>(box(GC) 5, box(GC) 72,
-                                      box(GC) 64, box(GC) 175);
-    }
-
     #[test]
     fn test_param_taggy() {
         test_parameterized::<Taggy>(One(1), Two(1, 2), Three(1, 2, 3), Two(17, 42));
index e84c894796736d249e83ea9fb887b738b1e34988..9e47142478e6b6f9f8c6ce2b9b8314065a703e1c 100644 (file)
@@ -529,9 +529,8 @@ fn test_rposition() {
 #[test]
 #[should_fail]
 fn test_rposition_fail() {
-    use std::gc::GC;
-    let v = [(box 0i, box(GC) 0i), (box 0i, box(GC) 0i),
-             (box 0i, box(GC) 0i), (box 0i, box(GC) 0i)];
+    let v = [(box 0i, box 0i), (box 0i, box 0i),
+             (box 0i, box 0i), (box 0i, box 0i)];
     let mut i = 0i;
     v.iter().rposition(|_elt| {
         if i == 2 {
index 98c01000cb06a71ed3f9746a28203a7ba85e890f..e27816c81653972aec579f2c68c438e20089cf26 100644 (file)
@@ -572,7 +572,6 @@ fn test_repr() {
     use std::io::stdio::println;
     use std::char::is_alphabetic;
     use std::mem::swap;
-    use std::gc::GC;
 
     fn exact_test<T>(t: &T, e:&str) {
         let mut m = io::MemWriter::new();
@@ -587,7 +586,6 @@ fn exact_test<T>(t: &T, e:&str) {
     exact_test(&1.234f64, "1.234f64");
     exact_test(&("hello"), "\"hello\"");
 
-    exact_test(&(box(GC) 10i), "box(GC) 10");
     exact_test(&(box 10i), "box 10");
     exact_test(&(&10i), "&10");
     let mut x = 10i;
@@ -601,8 +599,6 @@ fn exact_test<T>(t: &T, e:&str) {
                "&[\"hi\", \"there\"]");
     exact_test(&(P{a:10, b:1.234}),
                "repr::P{a: 10, b: 1.234f64}");
-    exact_test(&(box(GC) P{a:10, b:1.234}),
-               "box(GC) repr::P{a: 10, b: 1.234f64}");
     exact_test(&(box P{a:10, b:1.234}),
                "box repr::P{a: 10, b: 1.234f64}");
 
index e7ce5b7dca8cb05f616441053e3efc6c27b4c8db..fcef5981f0a35602c9d4e742130ac59bf1d266db 100644 (file)
@@ -411,7 +411,6 @@ mod tests {
     extern crate test;
 
     use std::prelude::*;
-    use std::gc::{Gc, GC};
     use super::*;
     use std::task;
 
@@ -467,11 +466,11 @@ fn test_tls_crust_automorestack_memorial_bug() {
     #[test]
     fn test_tls_multiple_types() {
         static str_key: Key<String> = &KeyValueKey;
-        static box_key: Key<Gc<()>> = &KeyValueKey;
+        static box_key: Key<Box<int>> = &KeyValueKey;
         static int_key: Key<int> = &KeyValueKey;
         task::spawn(proc() {
             str_key.replace(Some("string data".to_string()));
-            box_key.replace(Some(box(GC) ()));
+            box_key.replace(Some(box 0));
             int_key.replace(Some(42));
         });
     }
@@ -479,13 +478,13 @@ fn test_tls_multiple_types() {
     #[test]
     fn test_tls_overwrite_multiple_types() {
         static str_key: Key<String> = &KeyValueKey;
-        static box_key: Key<Gc<()>> = &KeyValueKey;
+        static box_key: Key<Box<int>> = &KeyValueKey;
         static int_key: Key<int> = &KeyValueKey;
         task::spawn(proc() {
             str_key.replace(Some("string data".to_string()));
             str_key.replace(Some("string data 2".to_string()));
-            box_key.replace(Some(box(GC) ()));
-            box_key.replace(Some(box(GC) ()));
+            box_key.replace(Some(box 0));
+            box_key.replace(Some(box 1));
             int_key.replace(Some(42));
             // This could cause a segfault if overwriting-destruction is done
             // with the crazy polymorphic transmute rather than the provided
@@ -498,13 +497,13 @@ fn test_tls_overwrite_multiple_types() {
     #[should_fail]
     fn test_tls_cleanup_on_failure() {
         static str_key: Key<String> = &KeyValueKey;
-        static box_key: Key<Gc<()>> = &KeyValueKey;
+        static box_key: Key<Box<int>> = &KeyValueKey;
         static int_key: Key<int> = &KeyValueKey;
         str_key.replace(Some("parent data".to_string()));
-        box_key.replace(Some(box(GC) ()));
+        box_key.replace(Some(box 0));
         task::spawn(proc() {
             str_key.replace(Some("string data".to_string()));
-            box_key.replace(Some(box(GC) ()));
+            box_key.replace(Some(box 2));
             int_key.replace(Some(42));
             fail!();
         });
index 9e88d05884ce920b0025b711addd0ff1c46794fb..ca5f76cf0d45a5122cdea9f84f877fe1d8c388b3 100644 (file)
@@ -554,23 +554,14 @@ mod test {
     use super::*;
     use std::prelude::*;
     use std::task;
-    use std::gc::{Gc, GC};
-
-    #[test]
-    fn local_heap() {
-        let a = box(GC) 5i;
-        let b = a;
-        assert!(*a == 5);
-        assert!(*b == 5);
-    }
 
     #[test]
     fn tls() {
-        local_data_key!(key: Gc<String>)
-        key.replace(Some(box(GC) "data".to_string()));
+        local_data_key!(key: String)
+        key.replace(Some("data".to_string()));
         assert_eq!(key.get().unwrap().as_slice(), "data");
-        local_data_key!(key2: Gc<String>)
-        key2.replace(Some(box(GC) "data".to_string()));
+        local_data_key!(key2: String)
+        key2.replace(Some("data".to_string()));
         assert_eq!(key2.get().unwrap().as_slice(), "data");
     }
 
@@ -605,23 +596,6 @@ fn comm_shared_chan() {
         assert!(rx.recv() == 10);
     }
 
-    #[test]
-    fn heap_cycles() {
-        use std::cell::RefCell;
-
-        struct List {
-            next: Option<Gc<RefCell<List>>>,
-        }
-
-        let a = box(GC) RefCell::new(List { next: None });
-        let b = box(GC) RefCell::new(List { next: Some(a) });
-
-        {
-            let mut a = a.borrow_mut();
-            a.next = Some(b);
-        }
-    }
-
     #[test]
     #[should_fail]
     fn test_begin_unwind() {
index b097e688b4272502df2dccb78613a63c10f9e81d..bbaf7991fd3cc5510c99ed9e1a5f1bc7529c2537 100644 (file)
@@ -10,7 +10,6 @@
 
 
 use std::cell::RefCell;
-use std::gc::{Gc, GC};
 
 pub struct Entry<A,B> {
     key: A,
@@ -19,7 +18,7 @@ pub struct Entry<A,B> {
 
 pub struct alist<A,B> {
     eq_fn: extern "Rust" fn(A,A) -> bool,
-    data: Gc<RefCell<Vec<Entry<A,B>>>>,
+    data: Box<RefCell<Vec<Entry<A,B>>>>,
 }
 
 pub fn alist_add<A:'static,B:'static>(lst: &alist<A,B>, k: A, v: B) {
@@ -47,7 +46,7 @@ pub fn new_int_alist<B:'static>() -> alist<int, B> {
     fn eq_int(a: int, b: int) -> bool { a == b }
     return alist {
         eq_fn: eq_int,
-        data: box(GC) RefCell::new(Vec::new()),
+        data: box RefCell::new(Vec::new()),
     };
 }
 
@@ -57,6 +56,6 @@ pub fn new_int_alist_2<B:'static>() -> alist<int, B> {
     fn eq_int(a: int, b: int) -> bool { a == b }
     return alist {
         eq_fn: eq_int,
-        data: box(GC) RefCell::new(Vec::new()),
+        data: box RefCell::new(Vec::new()),
     };
 }
index e9a249001764af6d7e67159ff88ce12bb7be3e8b..5e2a04001b5d6bca59b8ab86bcd2333923925125 100644 (file)
@@ -27,9 +27,8 @@ fn add(&self, _s: String) {
 
 pub mod rust {
     pub use name_pool::add;
-    use std::gc::Gc;
 
-    pub type rt = Gc<()>;
+    pub type rt = Box<()>;
 
     pub trait cx {
         fn cx(&self);
index 61c7d3f87dfb76775dfdabd2bdac1cf4dd128eb3..3bedbd9089ce2638f8eb91e220d3cba776a8b527 100644 (file)
@@ -13,9 +13,9 @@
 
 use std::cell::RefCell;
 use std::collections::HashMap;
-use std::gc::Gc;
+use std::rc::Rc;
 
-pub type header_map = HashMap<String, Gc<RefCell<Vec<Gc<String>>>>>;
+pub type header_map = HashMap<String, Rc<RefCell<Vec<Rc<String>>>>>;
 
 // the unused ty param is necessary so this gets monomorphized
 pub fn request<T>(req: &header_map) {
index 5d56db314b297c13c676cb5e81269185e70a731e..d9d393cc7492c010b247d2759bb15bc2049f94b6 100644 (file)
@@ -10,7 +10,6 @@
 
 
 use std::collections::HashMap;
-use std::gc::Gc;
 
-pub type map = Gc<HashMap<uint, uint>>;
+pub type map = Box<HashMap<uint, uint>>;
 
index ee7787d6fccf56bb02d7f7f6a5b2a1fb3830353a..961dad000914a0dfa3022b5520676bd81ba5e2bf 100644 (file)
@@ -56,8 +56,6 @@ pub enum FooEnum {
         VarB(uint, uint)
     }
 
-    // Skipping ty_box
-
     // Tests ty_uniq (of u8)
     pub type FooUniq = Box<u8>;
 
index 93b22edbf03e63197847809e7b841a994acd5f7e..6729373296b769cf67e450afb34688ad2c997b63 100644 (file)
 
 #![feature(unsafe_destructor)]
 
-extern crate collections;
 extern crate time;
 
 use time::precise_time_s;
 use std::os;
 use std::task;
-use std::vec;
-use std::gc::{Gc, GC};
 
 #[deriving(Clone)]
 enum List<T> {
-    Nil, Cons(T, Gc<List<T>>)
+    Nil, Cons(T, Box<List<T>>)
 }
 
 enum UniqueList {
@@ -53,15 +50,13 @@ fn run(repeat: int, depth: int) {
 // Filled with things that have to be unwound
 
 struct State {
-    managed: Gc<nillist>,
     unique: Box<nillist>,
-    tuple: (Gc<nillist>, Box<nillist>),
-    vec: Vec<Gc<nillist>>,
+    vec: Vec<Box<nillist>>,
     res: r
 }
 
 struct r {
-  _l: Gc<nillist>,
+  _l: Box<nillist>,
 }
 
 #[unsafe_destructor]
@@ -69,7 +64,7 @@ impl Drop for r {
     fn drop(&mut self) {}
 }
 
-fn r(l: Gc<nillist>) -> r {
+fn r(l: Box<nillist>) -> r {
     r {
         _l: l
     }
@@ -85,22 +80,17 @@ fn recurse_or_fail(depth: int, st: Option<State>) {
         let st = match st {
           None => {
             State {
-                managed: box(GC) Nil,
                 unique: box Nil,
-                tuple: (box(GC) Nil, box Nil),
-                vec: vec!(box(GC) Nil),
-                res: r(box(GC) Nil)
+                vec: vec!(box Nil),
+                res: r(box Nil)
             }
           }
           Some(st) => {
             State {
-                managed: box(GC) Cons((), st.managed),
-                unique: box Cons((), box(GC) *st.unique),
-                tuple: (box(GC) Cons((), st.tuple.ref0().clone()),
-                        box Cons((), box(GC) *st.tuple.ref1().clone())),
+                unique: box Cons((), box *st.unique),
                 vec: st.vec.clone().append(
-                        &[box(GC) Cons((), *st.vec.last().unwrap())]),
-                res: r(box(GC) Cons((), st.res._l))
+                        &[box Cons((), *st.vec.last().unwrap())]),
+                res: r(box Cons((), st.res._l))
             }
           }
         };
index 276c830cf5d48ba24d0e34110ef67f6f8f1bacc3..7aa3b30ce4919373468783639d78316033c8e4e5 100644 (file)
@@ -8,30 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-extern crate debug;
-
-use std::gc::{Gc, GC};
-
 struct clam {
-    x: Gc<int>,
-    y: Gc<int>,
+    x: Box<int>,
+    y: Box<int>,
 }
 
 struct fish {
-    a: Gc<int>,
+    a: Box<int>,
 }
 
 fn main() {
-    let a: clam = clam{x: box(GC) 1, y: box(GC) 2};
-    let b: clam = clam{x: box(GC) 10, y: box(GC) 20};
-    let z: int = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `Gc<int>`
-    println!("{:?}", z);
+    let a: clam = clam{x: box 1, y: box 2};
+    let b: clam = clam{x: box 10, y: box 20};
+    let z: int = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `Box<int>`
+    println!("{}", z);
     assert_eq!(z, 21);
-    let forty: fish = fish{a: box(GC) 40};
-    let two: fish = fish{a: box(GC) 2};
+    let forty: fish = fish{a: box 40};
+    let two: fish = fish{a: box 2};
     let answer: int = forty.a + two.a;
-    //~^ ERROR binary operation `+` cannot be applied to type `Gc<int>`
-    println!("{:?}", answer);
+    //~^ ERROR binary operation `+` cannot be applied to type `Box<int>`
+    println!("{}", answer);
     assert_eq!(answer, 42);
 }
diff --git a/src/test/compile-fail/borrowck-borrow-immut-deref-of-gc-as-mut.rs b/src/test/compile-fail/borrowck-borrow-immut-deref-of-gc-as-mut.rs
deleted file mode 100644 (file)
index 91eb20d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::GC;
-
-struct A;
-
-impl A {
-    fn foo(&mut self) {
-    }
-}
-
-pub fn main() {
-    let a = box(GC) A;
-    a.foo();
-    //~^ ERROR cannot borrow immutable dereference of `Gc` `*a` as mutable
-}
diff --git a/src/test/compile-fail/borrowck-managed-pointer-deref-scope.rs b/src/test/compile-fail/borrowck-managed-pointer-deref-scope.rs
deleted file mode 100644 (file)
index a8a7905..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Verify that managed pointers scope is treated like owned pointers.
-// regression test for #11586
-
-
-use std::gc::{GC, Gc};
-
-fn foo(x: &Gc<int>) -> &int {
-    match x {
-        &ref y => {
-            &**y // Do not expect an error here
-        }
-    }
-}
-
-fn bar() {
-    let a = 3i;
-    let mut y = &a;
-    if true {
-        let x = box(GC) 3i;
-        y = &*x; //~ ERROR `*x` does not live long enough
-    }
-}
-
-fn main() {}
diff --git a/src/test/compile-fail/borrowck-preserve-box-in-field.rs b/src/test/compile-fail/borrowck-preserve-box-in-field.rs
deleted file mode 100644 (file)
index ad1ac3c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// exec-env:RUST_POISON_ON_FREE=1
-
-
-use std::gc::GC;
-
-fn borrow(x: &int, f: |x: &int|) {
-    let before = *x;
-    f(x);
-    let after = *x;
-    assert_eq!(before, after);
-}
-
-struct F { f: Box<int> }
-
-pub fn main() {
-    let mut x = box(GC) F {f: box 3};
-    borrow(&*x.f, |b_x| {
-    //~^ ERROR cannot borrow `x` as mutable because `*x.f` is also borrowed as immutable
-        assert_eq!(*b_x, 3);
-        assert_eq!(&(*x.f) as *const int, &(*b_x) as *const int);
-        //~^ NOTE borrow occurs due to use of `x` in closure
-        x = box(GC) F {f: box 4};
-
-        println!("&*b_x = {:p}", &(*b_x));
-        assert_eq!(*b_x, 3);
-        assert!(&(*x.f) as *const int != &(*b_x) as *const int);
-    })
-}
diff --git a/src/test/compile-fail/borrowck-preserve-box-in-uniq.rs b/src/test/compile-fail/borrowck-preserve-box-in-uniq.rs
deleted file mode 100644 (file)
index ec52f05..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// exec-env:RUST_POISON_ON_FREE=1
-
-
-use std::gc::GC;
-
-fn borrow(x: &int, f: |x: &int|) {
-    let before = *x;
-    f(x);
-    let after = *x;
-    assert_eq!(before, after);
-}
-
-struct F { f: Box<int> }
-
-pub fn main() {
-    let mut x = box box(GC) F{f: box 3};
-    borrow(&*x.f, |b_x| {
-    //~^ ERROR cannot borrow `x` as mutable because `*x.f` is also borrowed as immutable
-        assert_eq!(*b_x, 3);
-        assert_eq!(&(*x.f) as *const int, &(*b_x) as *const int);
-        //~^ NOTE  borrow occurs due to use of `x` in closure
-        *x = box(GC) F{f: box 4};
-
-        println!("&*b_x = {:p}", &(*b_x));
-        assert_eq!(*b_x, 3);
-        assert!(&(*x.f) as *const int != &(*b_x) as *const int);
-    })
-}
diff --git a/src/test/compile-fail/borrowck-preserve-box.rs b/src/test/compile-fail/borrowck-preserve-box.rs
deleted file mode 100644 (file)
index 5aff482..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// exec-env:RUST_POISON_ON_FREE=1
-
-
-use std::gc::GC;
-
-fn borrow(x: &int, f: |x: &int|) {
-    let before = *x;
-    f(x);
-    let after = *x;
-    assert_eq!(before, after);
-}
-
-pub fn main() {
-    let mut x = box(GC) 3;
-    borrow(&*x, |b_x| {
-    //~^ ERROR cannot borrow `x` as mutable because `*x` is also borrowed as immutable
-        assert_eq!(*b_x, 3);
-        assert_eq!(&(*x) as *const int, &(*b_x) as *const int);
-        //~^ NOTE borrow occurs due to use of `x` in closure
-        x = box(GC) 22;
-
-        println!("&*b_x = {:p}", &(*b_x));
-        assert_eq!(*b_x, 3);
-        assert!(&(*x) as *const int != &(*b_x) as *const int);
-    })
-}
diff --git a/src/test/compile-fail/borrowck-preserve-cond-box.rs b/src/test/compile-fail/borrowck-preserve-cond-box.rs
deleted file mode 100644 (file)
index 6c3c340..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// exec-env:RUST_POISON_ON_FREE=1
-
-
-use std::gc::GC;
-
-fn testfn(cond: bool) {
-    let mut x = box(GC) 3i;
-    let mut y = box(GC) 4i;
-
-    // borrow x and y
-    let r_x = &*x;
-    let r_y = &*y;
-    let mut r = r_x;
-    let mut exp = 3;
-
-    if cond {
-        r = r_y;
-        exp = 4;
-    }
-
-    println!("*r = {}, exp = {}", *r, exp);
-    assert_eq!(*r, exp);
-
-    x = box(GC) 5i; //~ERROR cannot assign to `x` because it is borrowed
-    y = box(GC) 6i; //~ERROR cannot assign to `y` because it is borrowed
-
-    println!("*r = {}, exp = {}", *r, exp);
-    assert_eq!(*r, exp);
-    assert_eq!(x, box(GC) 5i);
-    assert_eq!(y, box(GC) 6i);
-}
-
-pub fn main() {
-    testfn(true);
-    testfn(false);
-}
diff --git a/src/test/compile-fail/borrowck-preserve-expl-deref.rs b/src/test/compile-fail/borrowck-preserve-expl-deref.rs
deleted file mode 100644 (file)
index 2ad042c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// exec-env:RUST_POISON_ON_FREE=1
-
-
-use std::gc::GC;
-
-fn borrow(x: &int, f: |x: &int|) {
-    let before = *x;
-    f(x);
-    let after = *x;
-    assert_eq!(before, after);
-}
-
-struct F { f: Box<int> }
-
-pub fn main() {
-    let mut x = box(GC) F {f: box 3};
-    borrow(&*(*x).f, |b_x| {
-    //~^ ERROR cannot borrow `x` as mutable because `*x.f` is also borrowed as immutable
-        assert_eq!(*b_x, 3);
-        assert_eq!(&(*x.f) as *const int, &(*b_x) as *const int);
-        //~^ NOTE borrow occurs due to use of `x` in closure
-        x = box(GC) F {f: box 4};
-
-        println!("&*b_x = {:p}", &(*b_x));
-        assert_eq!(*b_x, 3);
-        assert!(&(*x.f) as *const int != &(*b_x) as *const int);
-    })
-}
diff --git a/src/test/compile-fail/box-static-bound.rs b/src/test/compile-fail/box-static-bound.rs
deleted file mode 100644 (file)
index 29ee79b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-fn f<T>(x: T) -> Gc<T> {
-    box(GC) x  //~ ERROR the parameter type `T` may not live long enough
-}
-
-fn g<T:'static>(x: T) -> Gc<T> {
-    box(GC) x  // ok
-}
-
-fn main() {}
index 3e67419843cba283a3c36921e7860af5caca2625..e29be22ca9acc1494cfe3dae5ed86ea28f7fc473 100644 (file)
@@ -11,7 +11,6 @@
 // Verifies all possible restrictions for static items values.
 
 use std::kinds::marker;
-use std::gc::{Gc, GC};
 
 struct WithDtor;
 
@@ -124,9 +123,6 @@ fn drop(&mut self) {}
 static mut STATIC17: SafeEnum = Variant1;
 //~^ ERROR mutable static items are not allowed to have destructors
 
-static STATIC18: Gc<SafeStruct> = box(GC) SafeStruct{field1: Variant1, field2: Variant2(0)};
-//~^ ERROR static items are not allowed to have custom pointers
-
 static STATIC19: Box<int> = box 3;
 //~^ ERROR static items are not allowed to have custom pointers
 
index 06079a5487ff403a663d9cbdeb2dba6445730411..d77c552be034c60850fe070e74c322782773eb28 100644 (file)
@@ -8,11 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Testing that we can't store a reference it task-local storage
+// Testing that we can't store a reference in task-local storage
 
-use std::gc::{GC, Gc};
-
-local_data_key!(key: Gc<&int>)
+local_data_key!(key: Box<&int>)
 //~^ ERROR missing lifetime specifier
 
 fn main() {}
index 4512eb3f70aceeca7ac618493259cfa83192364b..8cbbfb7b83a55bd1e7abd8d14b2c266fc36c631b 100644 (file)
@@ -8,12 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::gc::{GC,Gc};
-
 fn main() {
     let x: Box<int> = box 0;
-    let y: Gc<int> = box (GC) 0;
 
     println!("{}", x + 1); //~ ERROR binary operation `+` cannot be applied to type `Box<int>`
-    println!("{}", y + 1); //~ ERROR binary operation `+` cannot be applied to type `Gc<int>`
 }
index 577ac480f60dc5f4fb3756d0582e947caca6b5bb..30cf7ee7d8888267f46239842a08331fb9193bbe 100644 (file)
@@ -9,17 +9,14 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 // test that autoderef of a type like this does not
 // cause compiler to loop.  Note that no instances
 // of such a type could ever be constructed.
-struct t { //~ ERROR this type cannot be instantiated
-  x: x,
+struct S { //~ ERROR this type cannot be instantiated
+  x: X,
   to_str: (),
 }
 
-struct x(Gc<t>); //~ ERROR this type cannot be instantiated
+struct X(Box<S>); //~ ERROR this type cannot be instantiated
 
-fn main() {
-}
+fn main() {}
index d3bd17a77420fd5fa40f21e45f65078be2fe28f2..cccf730095bdfad0ba5ad1a0902c717d934322bd 100644 (file)
@@ -8,17 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-use std::gc::Gc;
-
-struct P { child: Option<Gc<P>> }
+struct P { child: Option<Box<P>> }
 trait PTrait {
-   fn getChildOption(&self) -> Option<Gc<P>>;
+   fn getChildOption(&self) -> Option<Box<P>>;
 }
 
 impl PTrait for P {
-   fn getChildOption(&self) -> Option<Gc<P>> {
-       static childVal: Gc<P> = self.child.get();
+   fn getChildOption(&self) -> Option<Box<P>> {
+       static childVal: Box<P> = self.child.get();
        //~^ ERROR attempt to use a non-constant value in a constant
        fail!();
    }
index 9003578a0bb3e744e273aaba9a3f029f8de1b068..73d42aa0de1ad0871493fbb333aa0b558d99e3dd 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 mod my_mod {
     pub struct MyStruct {
         priv_field: int
@@ -29,11 +27,8 @@ fn main() {
     //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
     let _woohoo = (box my_struct).priv_field;
     //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
-    let _woohoo = (box(GC) my_struct).priv_field;
-    //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
     (&my_struct).happyfun();               //~ ERROR method `happyfun` is private
     (box my_struct).happyfun();            //~ ERROR method `happyfun` is private
-    (box(GC) my_struct).happyfun();               //~ ERROR method `happyfun` is private
     let nope = my_struct.priv_field;
     //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
 }
index a9e9416beb390c941d92c75f11bc38e3787923c8..c6869c44057f924885e18f2572723d5c7cfe1a52 100644 (file)
@@ -8,14 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-use std::gc::Gc;
-
 struct BarStruct;
 
 impl<'a> BarStruct {
-    fn foo(&'a mut self) -> Gc<BarStruct> { self }
-    //~^ ERROR: error: mismatched types: expected `Gc<BarStruct>`, found `&'a mut BarStruct
+    fn foo(&'a mut self) -> Box<BarStruct> { self }
+    //~^ ERROR: error: mismatched types: expected `Box<BarStruct>`, found `&'a mut BarStruct
 }
 
 fn main() {}
index 1c0295974c923c8e7dc059da64ed8e7d8e0fbe43..e29b8bc04d80e1a01fd0becdc406587668b073bc 100644 (file)
 
 
 use std::cell::RefCell;
-use std::gc::{Gc, GC};
 
 // Regresion test for issue 7364
-static managed: Gc<RefCell<int>> = box(GC) RefCell::new(0);
+static boxed: Box<RefCell<int>> = box RefCell::new(0);
 //~^ ERROR static items are not allowed to have custom pointers
 
 fn main() { }
index 3524d11d1842a621e2c05952cb956479a1eddb8c..499144698fb817296d0a5d85203a406cde678c7f 100644 (file)
@@ -12,7 +12,6 @@
 
 
 use std::rc::Rc;
-use std::gc::Gc;
 
 fn assert_copy<T:Copy>() { }
 trait Dummy { }
@@ -76,8 +75,7 @@ fn test<'a,T,U:Copy>(_: &'a int) {
     // structs containing non-POD are not ok
     assert_copy::<MyNoncopyStruct>(); //~ ERROR `core::kinds::Copy` is not implemented
 
-    // managed or ref counted types are not ok
-    assert_copy::<Gc<int>>();   //~ ERROR `core::kinds::Copy` is not implemented
+    // ref counted types are not ok
     assert_copy::<Rc<int>>();   //~ ERROR `core::kinds::Copy` is not implemented
 }
 
index e50bb8fbede657c63e537e6d596fa771a392c4eb..26b0c5503e32fac47361f26ddb7b9f0251d77023 100644 (file)
@@ -9,10 +9,10 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
+use std::rc::Rc;
 
 struct Foo {
-    f: Gc<int>,
+    f: Rc<int>,
 }
 
 impl Drop for Foo {
index f292d1599823ffeffc8af60f1747be13d05cc71c..6ca3f0174bb7449c524cd393d06c371074110f44 100644 (file)
@@ -9,12 +9,12 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
+use std::rc::Rc;
 
-fn foo(_x: Gc<uint>) {}
+fn foo(_x: Rc<uint>) {}
 
 fn main() {
-    let x = box(GC) 3u;
+    let x = Rc::new(3u);
     let _: proc():Send = proc() foo(x); //~ ERROR `core::kinds::Send` is not implemented
     let _: proc():Send = proc() foo(x); //~ ERROR `core::kinds::Send` is not implemented
     let _: proc():Send = proc() foo(x); //~ ERROR `core::kinds::Send` is not implemented
diff --git a/src/test/compile-fail/lint-heap-memory.rs b/src/test/compile-fail/lint-heap-memory.rs
deleted file mode 100644 (file)
index 375969f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![forbid(heap_memory)]
-#![allow(dead_code)]
-
-use std::gc::{Gc, GC};
-
-struct Foo {
-    x: Gc<int>, //~ ERROR type uses managed
-}
-
-struct Bar { x: Box<int> } //~ ERROR type uses owned
-
-fn main() {
-    let _x : Bar = Bar {x : box 10i}; //~ ERROR type uses owned
-
-    box(GC) 2i; //~ ERROR type uses managed
-
-    box 2i; //~ ERROR type uses owned
-    fn g(_: Box<Clone>) {} //~ ERROR type uses owned
-    proc() {}; //~ ERROR type uses owned
-}
diff --git a/src/test/compile-fail/lint-managed-heap-memory.rs b/src/test/compile-fail/lint-managed-heap-memory.rs
deleted file mode 100644 (file)
index 0a28242..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(dead_code)]
-#![forbid(managed_heap_memory)]
-
-use std::gc::{Gc, GC};
-
-struct Foo {
-    x: Gc<int> //~ ERROR type uses managed
-}
-
-fn main() {
-    let _x : Foo = Foo {x : box(GC) 10};
-    //~^ ERROR type uses managed
-}
diff --git a/src/test/compile-fail/new-box-syntax-bad.rs b/src/test/compile-fail/new-box-syntax-bad.rs
deleted file mode 100644 (file)
index 602ffe2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests that the new `box` syntax works with unique pointers and GC pointers.
-
-use std::gc::{Gc, GC};
-use std::boxed::{Box, HEAP};
-
-pub fn main() {
-    let x: Gc<int> = box(HEAP) 2;  //~ ERROR mismatched types
-    let y: Gc<int> = box(HEAP)(1 + 2);  //~ ERROR mismatched types
-    let z: Box<int> = box(GC)(4 + 5);   //~ ERROR mismatched types
-}
-
index ddbfbc41ecaf3cfd18bdca3a60ac004eb5359069..83dbd9ac1bf7282687c0575710d36425891508e3 100644 (file)
 
 #![feature(unsafe_destructor)]
 
-extern crate debug;
-
 use std::task;
-use std::gc::{Gc, GC};
+use std::rc::Rc;
 
-struct Port<T>(Gc<T>);
+#[deriving(Show)]
+struct Port<T>(Rc<T>);
 
 fn main() {
+    #[deriving(Show)]
     struct foo {
       _x: Port<()>,
     }
@@ -33,11 +33,11 @@ fn foo(x: Port<()>) -> foo {
         }
     }
 
-    let x = foo(Port(box(GC) ()));
+    let x = foo(Port(Rc::new(())));
 
     task::spawn(proc() {
         let y = x;
         //~^ ERROR `core::kinds::Send` is not implemented
-        println!("{:?}", y);
+        println!("{}", y);
     });
 }
index 69c012e0d8e0e466ef43a53957f4c28d7ef2f596..2765182225f96183a03ad52d0c6a98f3ec9eaf1c 100644 (file)
@@ -8,11 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::gc::GC;
 
 fn main() {
     let f;
     let g;
     g = f;
-    f = box(GC) g; //~ ERROR cyclic type of infinite size
+    f = box g; //~ ERROR cyclic type of infinite size
 }
index a00528616c3e5e3d0f4cdb5ac0edbf83a23bbcb9..44318b36f4b8a1c82b0137fc749f698e28ba9ead 100644 (file)
@@ -9,9 +9,7 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 fn main() {
     let f;
-    f = box(GC) f; //~ ERROR cyclic type of infinite size
+    f = box f; //~ ERROR cyclic type of infinite size
 }
diff --git a/src/test/compile-fail/pinned-deep-copy.rs b/src/test/compile-fail/pinned-deep-copy.rs
deleted file mode 100644 (file)
index 0e8bb40..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(unsafe_destructor)]
-
-extern crate debug;
-
-use std::cell::Cell;
-use std::gc::{Gc, GC};
-
-struct r {
-  i: Gc<Cell<int>>,
-}
-
-#[unsafe_destructor]
-impl Drop for r {
-    fn drop(&mut self) {
-        unsafe {
-            self.i.set(self.i.get() + 1);
-        }
-    }
-}
-
-fn r(i: Gc<Cell<int>>) -> r {
-    r {
-        i: i
-    }
-}
-
-struct A {
-    y: r,
-}
-
-fn main() {
-    let i = box(GC) Cell::new(0);
-    {
-        // Can't do this copy
-        let x = box box box A {y: r(i)};
-        let _z = x.clone(); //~ ERROR not implemented
-        println!("{:?}", x);
-    }
-    println!("{:?}", *i);
-}
diff --git a/src/test/compile-fail/regions-appearance-constraint.rs b/src/test/compile-fail/regions-appearance-constraint.rs
deleted file mode 100644 (file)
index 2c06805..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test no-special rooting is used for managed boxes
-
-
-use std::gc::GC;
-
-fn testfn(cond: bool) {
-    let mut x = box(GC) 3i;
-    let mut y = box(GC) 4i;
-
-    let mut a = &*x;
-
-    let mut exp = 3i;
-    if cond {
-        a = &*y;
-
-        exp = 4;
-    }
-
-    x = box(GC) 5i; //~ERROR cannot assign to `x` because it is borrowed
-    y = box(GC) 6i; //~ERROR cannot assign to `y` because it is borrowed
-    assert_eq!(*a, exp);
-    assert_eq!(x, box(GC) 5i);
-    assert_eq!(y, box(GC) 6i);
-}
-
-pub fn main() {}
index fc513b91f899aae03453c3fc8ddb42350a7ba3ac..b710578969b0d8bf6ed1f68585633c36c48174d4 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 struct point {
     x: int,
     y: int,
@@ -20,7 +18,7 @@ fn x_coord<'r>(p: &'r point) -> &'r int {
     return &p.x;
 }
 
-fn foo<'a>(p: Gc<point>) -> &'a int {
+fn foo<'a>(p: Box<point>) -> &'a int {
     let xc = x_coord(&*p); //~ ERROR `*p` does not live long enough
     assert_eq!(*xc, 3);
     return xc;
index 623b8e6319f88e0e91a862a6baeac843b7c354f0..cf1fa2cfc4c2cbd8986f850bf48f8d06becf6086 100644 (file)
@@ -9,11 +9,9 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 fn borrow<T>(x: &T) -> &T {x}
 
-fn foo(cond: || -> bool, make_box: || -> Gc<int>) {
+fn foo(cond: || -> bool, make_box: || -> Box<int>) {
     let mut y: &int;
     loop {
         let x = make_box();
index e862b36dcd1680a2ddd7d8408fd921c13676a125..f93907f5e5cb00497d4a6c17d2b9850bb664e1df 100644 (file)
 // Check that we correctly infer that b and c must be region
 // parameterized because they reference a which requires a region.
 
-use std::gc::Gc;
-
 type a<'a> = &'a int;
-type b<'a> = Gc<a<'a>>;
+type b<'a> = Box<a<'a>>;
 
 struct c<'a> {
-    f: Gc<b<'a>>
+    f: Box<b<'a>>
 }
 
 trait set_f<'a> {
-    fn set_f_ok(&mut self, b: Gc<b<'a>>);
-    fn set_f_bad(&mut self, b: Gc<b>);
+    fn set_f_ok(&mut self, b: Box<b<'a>>);
+    fn set_f_bad(&mut self, b: Box<b>);
 }
 
 impl<'a> set_f<'a> for c<'a> {
-    fn set_f_ok(&mut self, b: Gc<b<'a>>) {
+    fn set_f_ok(&mut self, b: Box<b<'a>>) {
         self.f = b;
     }
 
-    fn set_f_bad(&mut self, b: Gc<b>) {
-        self.f = b; //~ ERROR mismatched types: expected `Gc<Gc<&'a int>>`, found `Gc<Gc<&int>>`
+    fn set_f_bad(&mut self, b: Box<b>) {
+        self.f = b; //~ ERROR mismatched types: expected `Box<Box<&'a int>>`, found `Box<Box<&int>>`
     }
 }
 
index 2cb1f462e1daedb7613f7f5bfd64197b087299e3..1e5a5ecc08e0842946d8d255af1f5d6c6d51d768 100644 (file)
@@ -9,12 +9,10 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 fn f<T:'static>(_: T) {}
 
 fn main() {
-    let x = box(GC) 3i;
+    let x = box 3i;
     f(x);
     let x = &3i; //~ ERROR borrowed value does not live long enough
     f(x);
index 557341fd4f09ecdbcefad4155b5de191fdfefce4..2c3d48e9bf735795db5ea8af67e8e67a7b72343f 100644 (file)
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
-
 struct Foo<'a> {
     x: &'a int
 }
 
 pub fn main() {
-    let f = Foo { x: &*(box(GC) 3) }; //~ ERROR borrowed value does not live long enough
+    let f = Foo { x: &*(box 3) }; //~ ERROR borrowed value does not live long enough
     assert_eq!(*f.x, 3);
 }
index 0817d7c610ad1987297b88130ab615a16a82d8c7..53ebe1f9b5b64614e0c56ebdf5d6c1ee61099209 100644 (file)
@@ -9,18 +9,16 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 struct foo {
     a: int,
     b: int,
 }
 
-type bar = Gc<foo>;
+type bar = Box<foo>;
 
 fn want_foo(f: foo) {}
 fn have_bar(b: bar) {
-    want_foo(b); //~ ERROR (expected struct foo, found Gc-ptr)
+    want_foo(b); //~ ERROR (expected struct foo, found box)
 }
 
 fn main() {}
index bd844cc58603eed2554c87bbbafe29f468deb764..73224c7b45cec051d46695e80625460d40e734be 100644 (file)
@@ -9,15 +9,13 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 trait Mumbo {
-    fn jumbo(&self, x: Gc<uint>) -> uint;
+    fn jumbo(&self, x: &uint) -> uint;
 }
 
 impl Mumbo for uint {
     // Cannot have a larger effect than the trait:
-    unsafe fn jumbo(&self, x: Gc<uint>) { *self + *x; }
+    unsafe fn jumbo(&self, x: &uint) { *self + *x; }
     //~^ ERROR expected normal fn, found unsafe fn
 }
 
index 7d6cdaef85b2f35ca70deec321b5876f7a862d5e..4c2805bf4bd0c4d6c594d09ac8cc45a570e5599f 100644 (file)
@@ -9,12 +9,12 @@
 // except according to those terms.
 
 
-use std::gc::GC;
+use std::rc::Rc;
 
 fn f<T:Send>(_i: T) {
 }
 
 fn main() {
-    let i = box box(GC) 100i;
+    let i = box Rc::new(100i);
     f(i); //~ ERROR `core::kinds::Send` is not implemented
 }
index 54b1fdea7190d0dfd5bb773f1a729faaae622574..79f29c6b359d63629c9184805d7da9186c4695b4 100644 (file)
 
 #![feature(unsafe_destructor)]
 
-extern crate debug;
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
-struct r {
-  i: Gc<Cell<int>>,
+#[deriving(Show)]
+struct r<'a> {
+  i: &'a Cell<int>,
 }
 
 #[unsafe_destructor]
-impl Drop for r {
+impl<'a> Drop for r<'a> {
     fn drop(&mut self) {
         unsafe {
             self.i.set(self.i.get() + 1);
@@ -31,13 +30,13 @@ fn f<T>(_i: Vec<T> , _j: Vec<T> ) {
 }
 
 fn main() {
-    let i1 = box(GC) Cell::new(0);
-    let i2 = box(GC) Cell::new(1);
+    let i1 = &Cell::new(0);
+    let i2 = &Cell::new(1);
     let r1 = vec!(box r { i: i1 });
     let r2 = vec!(box r { i: i2 });
     f(r1.clone(), r2.clone());
     //~^ ERROR the trait `core::clone::Clone` is not implemented
     //~^^ ERROR the trait `core::clone::Clone` is not implemented
-    println!("{:?}", (r2, i1.get()));
-    println!("{:?}", (r1, i2.get()));
+    println!("{}", (r2, i1.get()));
+    println!("{}", (r1, i2.get()));
 }
index c3fea8e86d4f469536cfcbd967488010d4e6422a..102cb636550dba42336e365e83559141ddaae89a 100644 (file)
 // Test that a class with an unsendable field can't be
 // sent
 
-use std::gc::{Gc, GC};
+use std::rc::Rc;
 
 struct foo {
   i: int,
-  j: Gc<String>,
+  j: Rc<String>,
 }
 
-fn foo(i:int, j: Gc<String>) -> foo {
+fn foo(i:int, j: Rc<String>) -> foo {
     foo {
         i: i,
         j: j
@@ -29,5 +29,5 @@ fn foo(i:int, j: Gc<String>) -> foo {
 fn main() {
   let cat = "kitty".to_string();
   let (tx, _) = channel(); //~ ERROR `core::kinds::Send` is not implemented
-  tx.send(foo(42, box(GC) (cat))); //~ ERROR `core::kinds::Send` is not implemented
+  tx.send(foo(42, Rc::new(cat))); //~ ERROR `core::kinds::Send` is not implemented
 }
diff --git a/src/test/debuginfo/borrowed-managed-basic.rs b/src/test/debuginfo/borrowed-managed-basic.rs
deleted file mode 100644 (file)
index a2b8c54..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-android: FIXME(#10381)
-
-
-// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
-// its numerical value.
-
-// compile-flags:-g
-
-// === GDB TESTS ===================================================================================
-
-// gdb-command:rbreak zzz
-// gdb-command:run
-// gdb-command:finish
-// gdb-command:print *bool_ref
-// gdb-check:$1 = true
-
-// gdb-command:print *int_ref
-// gdb-check:$2 = -1
-
-// gdb-command:print *char_ref
-// gdb-check:$3 = 97
-
-// gdb-command:print/d *i8_ref
-// gdb-check:$4 = 68
-
-// gdb-command:print *i16_ref
-// gdb-check:$5 = -16
-
-// gdb-command:print *i32_ref
-// gdb-check:$6 = -32
-
-// gdb-command:print *i64_ref
-// gdb-check:$7 = -64
-
-// gdb-command:print *uint_ref
-// gdb-check:$8 = 1
-
-// gdb-command:print/d *u8_ref
-// gdb-check:$9 = 100
-
-// gdb-command:print *u16_ref
-// gdb-check:$10 = 16
-
-// gdb-command:print *u32_ref
-// gdb-check:$11 = 32
-
-// gdb-command:print *u64_ref
-// gdb-check:$12 = 64
-
-// gdb-command:print *f32_ref
-// gdb-check:$13 = 2.5
-
-// gdb-command:print *f64_ref
-// gdb-check:$14 = 3.5
-
-
-// === LLDB TESTS ==================================================================================
-
-// lldb-command:type format add -f decimal char
-// lldb-command:type format add -f decimal 'unsigned char'
-// lldb-command:run
-
-// lldb-command:print *bool_ref
-// lldb-check:[...]$0 = true
-
-// lldb-command:print *int_ref
-// lldb-check:[...]$1 = -1
-
-// LLDB can't handle 32bit chars yet
-// d ebugger:print *char_ref
-// c heck:[...]$x = 97
-
-// lldb-command:print *i8_ref
-// lldb-check:[...]$2 = 68
-
-// lldb-command:print *i16_ref
-// lldb-check:[...]$3 = -16
-
-// lldb-command:print *i32_ref
-// lldb-check:[...]$4 = -32
-
-// lldb-command:print *i64_ref
-// lldb-check:[...]$5 = -64
-
-// lldb-command:print *uint_ref
-// lldb-check:[...]$6 = 1
-
-// lldb-command:print *u8_ref
-// lldb-check:[...]$7 = 100
-
-// lldb-command:print *u16_ref
-// lldb-check:[...]$8 = 16
-
-// lldb-command:print *u32_ref
-// lldb-check:[...]$9 = 32
-
-// lldb-command:print *u64_ref
-// lldb-check:[...]$10 = 64
-
-// lldb-command:print *f32_ref
-// lldb-check:[...]$11 = 2.5
-
-// lldb-command:print *f64_ref
-// lldb-check:[...]$12 = 3.5
-
-#![allow(unused_variable)]
-
-use std::gc::{Gc, GC};
-
-fn main() {
-    let bool_box: Gc<bool> = box(GC) true;
-    let bool_ref: &bool = &*bool_box;
-
-    let int_box: Gc<int> = box(GC) -1;
-    let int_ref: &int = &*int_box;
-
-    let char_box: Gc<char> = box(GC) 'a';
-    let char_ref: &char = &*char_box;
-
-    let i8_box: Gc<i8> = box(GC) 68;
-    let i8_ref: &i8 = &*i8_box;
-
-    let i16_box: Gc<i16> = box(GC) -16;
-    let i16_ref: &i16 = &*i16_box;
-
-    let i32_box: Gc<i32> = box(GC) -32;
-    let i32_ref: &i32 = &*i32_box;
-
-    let i64_box: Gc<i64> = box(GC) -64;
-    let i64_ref: &i64 = &*i64_box;
-
-    let uint_box: Gc<uint> = box(GC) 1;
-    let uint_ref: &uint = &*uint_box;
-
-    let u8_box: Gc<u8> = box(GC) 100;
-    let u8_ref: &u8 = &*u8_box;
-
-    let u16_box: Gc<u16> = box(GC) 16;
-    let u16_ref: &u16 = &*u16_box;
-
-    let u32_box: Gc<u32> = box(GC) 32;
-    let u32_ref: &u32 = &*u32_box;
-
-    let u64_box: Gc<u64> = box(GC) 64;
-    let u64_ref: &u64 = &*u64_box;
-
-    let f32_box: Gc<f32> = box(GC) 2.5;
-    let f32_ref: &f32 = &*f32_box;
-
-    let f64_box: Gc<f64> = box(GC) 3.5;
-    let f64_ref: &f64 = &*f64_box;
-
-    zzz(); // #break
-}
-
-fn zzz() {()}
index 02131734fb1af02ca30bb669744707d83c7a0332..8b9c790bbbf5875dc1012fa77763a91e29b55549 100644 (file)
 // gdb-command:print *ref_to_unnamed
 // gdb-check:$4 = {x = 11, y = 24.5}
 
-// gdb-command:print *managed_val_ref
-// gdb-check:$5 = {x = 12, y = 25.5}
-
-// gdb-command:print *managed_val_interior_ref_1
-// gdb-check:$6 = 12
-
-// gdb-command:print *managed_val_interior_ref_2
-// gdb-check:$7 = 25.5
-
 // gdb-command:print *unique_val_ref
 // gdb-check:$8 = {x = 13, y = 26.5}
 
 // lldb-command:print *ref_to_unnamed
 // lldb-check:[...]$3 = SomeStruct { x: 11, y: 24.5 }
 
-// lldb-command:print *managed_val_ref
-// lldb-check:[...]$4 = SomeStruct { x: 12, y: 25.5 }
-
-// lldb-command:print *managed_val_interior_ref_1
-// lldb-check:[...]$5 = 12
-
-// lldb-command:print *managed_val_interior_ref_2
-// lldb-check:[...]$6 = 25.5
-
 // lldb-command:print *unique_val_ref
 // lldb-check:[...]$7 = SomeStruct { x: 13, y: 26.5 }
 
@@ -84,8 +66,6 @@
 
 #![allow(unused_variable)]
 
-use std::gc::GC;
-
 struct SomeStruct {
     x: int,
     y: f64
@@ -98,11 +78,6 @@ fn main() {
     let stack_val_interior_ref_2: &f64 = &stack_val.y;
     let ref_to_unnamed: &SomeStruct = &SomeStruct { x: 11, y: 24.5 };
 
-    let managed_val = box(GC) SomeStruct { x: 12, y: 25.5 };
-    let managed_val_ref: &SomeStruct = &*managed_val;
-    let managed_val_interior_ref_1: &int = &managed_val.x;
-    let managed_val_interior_ref_2: &f64 = &managed_val.y;
-
     let unique_val = box SomeStruct { x: 13, y: 26.5 };
     let unique_val_ref: &SomeStruct = &*unique_val;
     let unique_val_interior_ref_1: &int = &unique_val.x;
index 555306365713812285d5816d93ccb161987ff89e..2c78d14a86c755abc65261f7e3f036f3ef73a38e 100644 (file)
@@ -25,9 +25,6 @@
 // gdb-command:print *ref_to_unnamed
 // gdb-check:$2 = {-15, -20}
 
-// gdb-command:print *managed_val_ref
-// gdb-check:$3 = {-16, -21}
-
 // gdb-command:print *unique_val_ref
 // gdb-check:$4 = {-17, -22}
 
 // lldb-command:print *ref_to_unnamed
 // lldb-check:[...]$1 = (-15, -20)
 
-// lldb-command:print *managed_val_ref
-// lldb-check:[...]$2 = (-16, -21)
-
 // lldb-command:print *unique_val_ref
 // lldb-check:[...]$3 = (-17, -22)
 
 
 #![allow(unused_variable)]
 
-use std::gc::{Gc, GC};
-
 fn main() {
     let stack_val: (i16, f32) = (-14, -19f32);
     let stack_val_ref: &(i16, f32) = &stack_val;
     let ref_to_unnamed: &(i16, f32) = &(-15, -20f32);
 
-    let managed_val: Gc<(i16, f32)> = box(GC) (-16, -21f32);
-    let managed_val_ref: &(i16, f32) = &*managed_val;
-
     let unique_val: Box<(i16, f32)> = box() (-17, -22f32);
     let unique_val_ref: &(i16, f32) = &*unique_val;
 
index 1a07f614c14c7f19e9ba79e87df634ddf9de31e9..c459b9be3d09ca08660e2435b8ad5a449d2c77d7 100644 (file)
 // gdb-check:$1 = 1
 // gdb-command:print *b
 // gdb-check:$2 = {2, 3.5}
-// gdb-command:print c->val
-// gdb-check:$3 = 4
-// gdb-command:print d->val
-// gdb-check:$4 = false
 
 
 // === LLDB TESTS ==================================================================================
 // lldb-check:[...]$0 = 1
 // lldb-command:print *b
 // lldb-check:[...]$1 = (2, 3.5)
-// lldb-command:print c->val
-// lldb-check:[...]$2 = 4
-// lldb-command:print d->val
-// lldb-check:[...]$3 = false
 
 #![allow(unused_variable)]
 
-use std::gc::GC;
-
 fn main() {
     let a = box 1i;
     let b = box() (2i, 3.5f64);
-    let c = box(GC) 4i;
-    let d = box(GC) false;
 
     zzz(); // #break
 }
index d3a556e40099a90d41f7c3e511cf494ba7f5c631..a22b9fdea5c8f273a13ab140f174b37283c9e9bd 100644 (file)
 // gdb-command:print *unique
 // gdb-check:$1 = {x = 99, y = 999, z = 9999, w = 99999}
 
-// gdb-command:print managed->val
-// gdb-check:$2 = {x = 88, y = 888, z = 8888, w = 88888}
-
 // gdb-command:print *unique_dtor
 // gdb-check:$3 = {x = 77, y = 777, z = 7777, w = 77777}
 
-// gdb-command:print managed_dtor->val
-// gdb-check:$4 = {x = 33, y = 333, z = 3333, w = 33333}
-
 
 // === LLDB TESTS ==================================================================================
 
 // lldb-command:print *unique
 // lldb-check:[...]$0 = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 }
 
-// lldb-command:print managed->val
-// lldb-check:[...]$1 = StructWithSomePadding { x: 88, y: 888, z: 8888, w: 88888 }
-
 // lldb-command:print *unique_dtor
 // lldb-check:[...]$2 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 }
 
-// lldb-command:print managed_dtor->val
-// lldb-check:[...]$3 = StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 }
-
 #![allow(unused_variable)]
 
-use std::gc::GC;
-
 struct StructWithSomePadding {
     x: i16,
     y: i32,
@@ -72,11 +58,8 @@ fn drop(&mut self) {}
 fn main() {
 
     let unique = box StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 };
-    let managed = box(GC) StructWithSomePadding { x: 88, y: 888, z: 8888, w: 88888 };
 
     let unique_dtor = box StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 };
-    let managed_dtor = box(GC) StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 };
-
     zzz(); // #break
 }
 
index af1b38adf80d21ef4e3b41ce41efc7e988b6f0dd..11df00ee4fe2683f3f7bb8376c9dd6a14876499d 100644 (file)
 // gdb-check:$3 = {4444.5, 5555, 6666, 7777.5}
 // gdb-command:continue
 
-// gdb-command:finish
-// gdb-command:print self->val
-// gdb-check:$4 = 8888
-// gdb-command:continue
-
 
 // === LLDB TESTS ==================================================================================
 
 // lldb-check:[...]$2 = (4444.5, 5555, 6666, 7777.5)
 // lldb-command:continue
 
-// lldb-command:print self->val
-// lldb-check:[...]$3 = 8888
-// lldb-command:continue
-
-use std::gc::{Gc, GC};
-
 trait Trait {
     fn method(self) -> Self;
 }
@@ -91,18 +80,10 @@ fn method(self) -> (f64, int, int, f64) {
     }
 }
 
-impl Trait for Gc<int> {
-    fn method(self) -> Gc<int> {
-        zzz(); // #break
-        self
-    }
-}
-
 fn main() {
     let _ = (1111 as int).method();
     let _ = Struct { x: 2222, y: 3333 }.method();
     let _ = (4444.5, 5555, 6666, 7777.5).method();
-    let _ = (box(GC) 8888).method();
 }
 
 fn zzz() { () }
diff --git a/src/test/debuginfo/managed-enum.rs b/src/test/debuginfo/managed-enum.rs
deleted file mode 100644 (file)
index e5da4d2..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-android: FIXME(#10381)
-
-// compile-flags:-g
-
-// === GDB TESTS ===================================================================================
-
-// gdb-command:rbreak zzz
-// gdb-command:run
-// gdb-command:finish
-
-// gdb-command:print the_a->val
-// gdb-check:$1 = {{TheA, x = 0, y = 8970181431921507452}, {TheA, 0, 2088533116, 2088533116}}
-
-// gdb-command:print the_b->val
-// gdb-check:$2 = {{TheB, x = 0, y = 1229782938247303441}, {TheB, 0, 286331153, 286331153}}
-
-// gdb-command:print univariant->val
-// gdb-check:$3 = {{-9747455}}
-
-
-// === LLDB TESTS ==================================================================================
-
-// lldb-command:run
-
-// lldb-command:print the_a->val
-// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 }
-
-// lldb-command:print the_b->val
-// lldb-check:[...]$1 = TheB(0, 286331153, 286331153)
-
-// lldb-command:print univariant->val
-// lldb-check:[...]$2 = TheOnlyCase(-9747455)
-
-#![allow(unused_variable)]
-#![feature(struct_variant)]
-
-use std::gc::GC;
-
-// The first element is to ensure proper alignment, irrespective of the machines word size. Since
-// the size of the discriminant value is machine dependent, this has be taken into account when
-// datatype layout should be predictable as in this case.
-enum ABC {
-    TheA { x: i64, y: i64 },
-    TheB (i64, i32, i32),
-}
-
-// This is a special case since it does not have the implicit discriminant field.
-enum Univariant {
-    TheOnlyCase(i64)
-}
-
-fn main() {
-
-    // In order to avoid endianess trouble all of the following test values consist of a single
-    // repeated byte. This way each interpretation of the union should look the same, no matter if
-    // this is a big or little endian machine.
-
-    // 0b0111110001111100011111000111110001111100011111000111110001111100 = 8970181431921507452
-    // 0b01111100011111000111110001111100 = 2088533116
-    // 0b0111110001111100 = 31868
-    // 0b01111100 = 124
-    let the_a = box(GC) TheA { x: 0, y: 8970181431921507452 };
-
-    // 0b0001000100010001000100010001000100010001000100010001000100010001 = 1229782938247303441
-    // 0b00010001000100010001000100010001 = 286331153
-    // 0b0001000100010001 = 4369
-    // 0b00010001 = 17
-    let the_b = box(GC) TheB (0, 286331153, 286331153);
-
-    let univariant = box(GC) TheOnlyCase(-9747455);
-
-    zzz(); // #break
-}
-
-fn zzz() {()}
diff --git a/src/test/debuginfo/managed-pointer-within-unique-vec.rs b/src/test/debuginfo/managed-pointer-within-unique-vec.rs
deleted file mode 100644 (file)
index 69f3938..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-android: FIXME(#10381)
-
-
-// compile-flags:-g
-
-// === GDB TESTS ===================================================================================
-
-// gdb-command:rbreak zzz
-// gdb-command:run
-// gdb-command:finish
-
-// gdb-command:print unique.ptr[0]->val
-// gdb-check:$1 = 10
-
-// gdb-command:print unique.ptr[1]->val
-// gdb-check:$2 = 11
-
-// gdb-command:print unique.ptr[2]->val
-// gdb-check:$3 = 12
-
-// gdb-command:print unique.ptr[3]->val
-// gdb-check:$4 = 13
-
-
-// === LLDB TESTS ==================================================================================
-
-// lldb-command:run
-
-// lldb-command:print unique.ptr[0]->val
-// lldb-check:[...]$0 = 10
-
-// lldb-command:print unique.ptr[1]->val
-// lldb-check:[...]$1 = 11
-
-// lldb-command:print unique.ptr[2]->val
-// lldb-check:[...]$2 = 12
-
-// lldb-command:print unique.ptr[3]->val
-// lldb-check:[...]$3 = 13
-
-
-#![allow(unused_variable)]
-
-use std::gc::{Gc, GC};
-
-fn main() {
-
-    let unique: Vec<Gc<i64>> = vec!(box(GC) 10, box(GC) 11, box(GC) 12, box(GC) 13);
-
-    zzz(); // #break
-}
-
-fn zzz() {()}
diff --git a/src/test/debuginfo/managed-pointer-within-unique.rs b/src/test/debuginfo/managed-pointer-within-unique.rs
deleted file mode 100644 (file)
index 2690efb..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-android: FIXME(#10381)
-
-
-// compile-flags:-g
-
-// === GDB TESTS ===================================================================================
-
-// gdb-command:set print pretty off
-// gdb-command:rbreak zzz
-// gdb-command:run
-// gdb-command:finish
-
-// gdb-command:print *ordinary_unique
-// gdb-check:$1 = {-1, -2}
-
-// gdb-command:print managed_within_unique->x
-// gdb-check:$2 = -3
-
-// gdb-command:print managed_within_unique->y->val
-// gdb-check:$3 = -4
-
-// === LLDB TESTS ==================================================================================
-
-// lldb-command:run
-
-// lldb-command:print *ordinary_unique
-// lldb-check:[...]$0 = (-1, -2)
-
-// lldb-command:print managed_within_unique->x
-// lldb-check:[...]$1 = -3
-
-// lldb-command:print managed_within_unique->y->val
-// lldb-check:[...]$2 = -4
-
-#![allow(unused_variable)]
-
-use std::gc::{GC, Gc};
-
-struct ContainsManaged {
-    x: int,
-    y: Gc<int>,
-}
-
-fn main() {
-    let ordinary_unique = box() (-1i, -2i);
-
-    let managed_within_unique = box ContainsManaged { x: -3, y: box(GC) -4i };
-
-    zzz(); // #break
-}
-
-fn zzz() {()}
index 76722b743d7313113353500aa82fb818e2ff1e50..412bdfaaf15aca8dd466929d5bcd150da51f25c6 100644 (file)
 // gdb-command:print unique_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
 // gdb-check:$4 = 3
 
-// gdb-command:print box_unique->val.value
-// gdb-check:$5 = 4
-// gdb-command:print box_unique->val.next.RUST$ENCODED$ENUM$0$Empty.val->value
-// gdb-check:$6 = 5
-
 // gdb-command:print vec_unique[0].value
 // gdb-check:$7 = 6.5
 // gdb-command:print vec_unique[0].next.RUST$ENCODED$ENUM$0$Empty.val->value
 // gdb-command:print borrowed_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
 // gdb-check:$10 = 9.5
 
-// MANAGED
-// gdb-command:print stack_managed.value
-// gdb-check:$11 = 10
-// gdb-command:print stack_managed.next.RUST$ENCODED$ENUM$0$Empty.val->val.value
-// gdb-check:$12 = 11
-
-// gdb-command:print unique_managed->value
-// gdb-check:$13 = 12
-// gdb-command:print unique_managed->next.RUST$ENCODED$ENUM$0$Empty.val->val.value
-// gdb-check:$14 = 13
-
-// gdb-command:print box_managed.val->value
-// gdb-check:$15 = 14
-// gdb-command:print box_managed->val->next.RUST$ENCODED$ENUM$0$Empty.val->val.value
-// gdb-check:$16 = 15
-
-// gdb-command:print vec_managed[0].value
-// gdb-check:$17 = 16.5
-// gdb-command:print vec_managed[0].next.RUST$ENCODED$ENUM$0$Empty.val->val.value
-// gdb-check:$18 = 17.5
-
-// gdb-command:print borrowed_managed->value
-// gdb-check:$19 = 18.5
-// gdb-command:print borrowed_managed->next.RUST$ENCODED$ENUM$0$Empty.val->val.value
-// gdb-check:$20 = 19.5
-
 // LONG CYCLE
 // gdb-command:print long_cycle1.value
 // gdb-check:$21 = 20
 #![allow(unused_variable)]
 #![feature(struct_variant)]
 
-use std::gc::{Gc, GC};
-
 enum Opt<T> {
     Empty,
     Val { val: T }
@@ -118,11 +85,6 @@ struct UniqueNode<T> {
     value: T
 }
 
-struct ManagedNode<T> {
-    next: Opt<Gc<ManagedNode<T>>>,
-    value: T
-}
-
 struct LongCycle1<T> {
     next: Box<LongCycle2<T>>,
     value: T,
@@ -184,16 +146,6 @@ fn main() {
         value: 2,
     };
 
-    let box_unique: Gc<UniqueNode<u64>> = box(GC) UniqueNode {
-        next: Val {
-            val: box UniqueNode {
-                next: Empty,
-                value: 5,
-            }
-        },
-        value: 4,
-    };
-
     let vec_unique: [UniqueNode<f32>, ..1] = [UniqueNode {
         next: Val {
             val: box UniqueNode {
@@ -214,56 +166,6 @@ fn main() {
         value: 8.5,
     };
 
-    let stack_managed: ManagedNode<u16> = ManagedNode {
-        next: Val {
-            val: box(GC) ManagedNode {
-                next: Empty,
-                value: 11,
-            }
-        },
-        value: 10,
-    };
-
-    let unique_managed: Box<ManagedNode<u32>> = box ManagedNode {
-        next: Val {
-            val: box(GC) ManagedNode {
-                next: Empty,
-                value: 13,
-            }
-        },
-        value: 12,
-    };
-
-    let box_managed: Gc<ManagedNode<u64>> = box(GC) ManagedNode {
-        next: Val {
-            val: box(GC) ManagedNode {
-                next: Empty,
-                value: 15,
-            }
-        },
-        value: 14,
-    };
-
-    let vec_managed: [ManagedNode<f32>, ..1] = [ManagedNode {
-        next: Val {
-            val: box(GC) ManagedNode {
-                next: Empty,
-                value: 17.5,
-            }
-        },
-        value: 16.5,
-    }];
-
-    let borrowed_managed: &ManagedNode<f64> = &ManagedNode {
-        next: Val {
-            val: box(GC) ManagedNode {
-                next: Empty,
-                value: 19.5,
-            }
-        },
-        value: 18.5,
-    };
-
     // LONG CYCLE
     let long_cycle1: LongCycle1<u16> = LongCycle1 {
         next: box LongCycle2 {
index a08cc6bdb6e2c16d33820932dbec67c877b756d6..89415df3588fa7878c14f4a5c322511ddbd8db19 100644 (file)
@@ -28,8 +28,6 @@
 // gdb-check:$4 = {a = -3, b = 4.5, c = 5}
 // gdb-command:print *owned
 // gdb-check:$5 = 6
-// gdb-command:print managed->val
-// gdb-check:$6 = 7
 // gdb-command:print closure_local
 // gdb-check:$7 = 8
 // gdb-command:continue
@@ -45,8 +43,6 @@
 // gdb-check:$11 = {a = -3, b = 4.5, c = 5}
 // gdb-command:print *owned
 // gdb-check:$12 = 6
-// gdb-command:print managed->val
-// gdb-check:$13 = 7
 // gdb-command:print closure_local
 // gdb-check:$14 = 8
 // gdb-command:continue
@@ -66,8 +62,6 @@
 // lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
 // lldb-command:print *owned
 // lldb-check:[...]$4 = 6
-// lldb-command:print managed->val
-// lldb-check:[...]$5 = 7
 // lldb-command:print closure_local
 // lldb-check:[...]$6 = 8
 // lldb-command:continue
 // lldb-check:[...]$10 = Struct { a: -3, b: 4.5, c: 5 }
 // lldb-command:print *owned
 // lldb-check:[...]$11 = 6
-// lldb-command:print managed->val
-// lldb-check:[...]$12 = 7
 // lldb-command:print closure_local
 // lldb-check:[...]$13 = 8
 // lldb-command:continue
 
 #![allow(unused_variable)]
 
-use std::gc::GC;
-
 struct Struct {
     a: int,
     b: f64,
@@ -110,14 +100,13 @@ fn main() {
 
     let struct_ref = &a_struct;
     let owned = box 6;
-    let managed = box(GC) 7;
 
     let closure = || {
         let closure_local = 8;
 
         let nested_closure = || {
             zzz(); // #break
-            variable = constant + a_struct.a + struct_ref.a + *owned + *managed + closure_local;
+            variable = constant + a_struct.a + struct_ref.a + *owned + closure_local;
         };
 
         zzz(); // #break
index c37f0ddbe99c2973330e883573173b367b650833..8ea407fc54470ab0b51a757c43b4d97be56997d2 100644 (file)
@@ -28,8 +28,6 @@
 // gdb-check:$4 = {a = -3, b = 4.5, c = 5}
 // gdb-command:print *owned
 // gdb-check:$5 = 6
-// gdb-command:print managed->val
-// gdb-check:$6 = 7
 
 
 // === LLDB TESTS ==================================================================================
 // lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
 // lldb-command:print *owned
 // lldb-check:[...]$4 = 6
-// lldb-command:print managed->val
-// lldb-check:[...]$5 = 7
 
 #![allow(unused_variable)]
 
-use std::gc::GC;
-
 struct Struct {
     a: int,
     b: f64,
@@ -71,11 +65,10 @@ fn main() {
 
     let struct_ref = &a_struct;
     let owned = box 6;
-    let managed = box(GC) 7;
 
     let closure = || {
         zzz(); // #break
-        variable = constant + a_struct.a + struct_ref.a + *owned + *managed;
+        variable = constant + a_struct.a + struct_ref.a + *owned;
     };
 
     closure();
index 3f6d5b8c18abe0bde53f242a778f4b58946d223f..01fc70c1d2cc1cf9d08540a0e52db0f0b8075c46 100644 (file)
 
 
 use std::cell::Cell;
-use std::gc::GC;
 
-fn test1() { let val = box(GC) 0i; { } *val; }
+fn test1() { let val = &0i; { } *val; }
 
-fn test2() -> int { let val = box(GC) 0i; { } *val }
+fn test2() -> int { let val = &0i; { } *val }
 
 struct S { eax: int }
 
 fn test3() {
-    let regs = box(GC) Cell::new(S {eax: 0});
+    let regs = &Cell::new(S {eax: 0});
     match true { true => { } _ => { } }
     regs.set(S {eax: 1});
 }
 
-fn test4() -> bool { let regs = box(GC) true; if true { } *regs || false }
+fn test4() -> bool { let regs = &true; if true { } *regs || false }
 
 fn test5() -> (int, int) { { } (0, 1) }
 
 fn test6() -> bool { { } (true || false) && true }
 
 fn test7() -> uint {
-    let regs = box(GC) 0i;
+    let regs = &0i;
     match true { true => { } _ => { } }
     (*regs < 2) as uint
 }
 
 fn test8() -> int {
-    let val = box(GC) 0i;
+    let val = &0i;
     match true {
         true => { }
         _    => { }
@@ -54,12 +53,12 @@ fn test8() -> int {
 }
 
 fn test9() {
-    let regs = box(GC) Cell::new(0i);
+    let regs = &Cell::new(0i);
     match true { true => { } _ => { } } regs.set(regs.get() + 1);
 }
 
 fn test10() -> int {
-    let regs = box(GC) vec!(0i);
+    let regs = vec!(0i);
     match true { true => { } _ => { } }
     *(*regs).get(0)
 }
index d8ba7e1b78868ec2d5253d1f9d589e82b915aef8..5e1b7bb69bb2bf29ec81d6f57fa0065f99f62b0e 100644 (file)
@@ -11,8 +11,6 @@
 
 // error-pattern:meep
 
-use std::gc::{Gc, GC};
+fn f(_a: int, _b: int, _c: Box<int>) { fail!("moop"); }
 
-fn f(_a: int, _b: int, _c: Gc<int>) { fail!("moop"); }
-
-fn main() { f(1, fail!("meep"), box(GC) 42); }
+fn main() { f(1, fail!("meep"), box 42); }
diff --git a/src/test/run-fail/issue-2272.rs b/src/test/run-fail/issue-2272.rs
deleted file mode 100644 (file)
index 87de4d3..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-// error-pattern:explicit failure
-// Issue #2272 - unwind this without leaking the unique pointer
-
-use std::gc::{Gc, GC};
-
-struct X { y: Y, a: Box<int> }
-
-struct Y { z: Gc<int> }
-
-fn main() {
-    let _x = X {
-        y: Y {
-            z: box(GC) 0
-        },
-        a: box 0
-    };
-    fail!();
-}
diff --git a/src/test/run-fail/unwind-assert.rs b/src/test/run-fail/unwind-assert.rs
deleted file mode 100644 (file)
index 4947093..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn main() {
-    let _a = box(GC) 0i;
-    assert!(false);
-}
diff --git a/src/test/run-fail/unwind-box-fn-unique.rs b/src/test/run-fail/unwind-box-fn-unique.rs
deleted file mode 100644 (file)
index 7ed58be..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-// error-pattern:fail
-
-extern crate debug;
-
-use std::gc::{GC, Gc};
-
-fn failfn() {
-    fail!();
-}
-
-fn main() {
-    let y = box 0i;
-    let x: Gc<proc():Send> = box(GC) (proc() {
-        println!("{:?}", y.clone());
-    });
-    failfn();
-    println!("{:?}", x);
-}
diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs
deleted file mode 100644 (file)
index ede8331..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-extern crate debug;
-
-use std::mem;
-use std::gc::GC;
-
-fn failfn() {
-    fail!();
-}
-
-struct r {
-  v: *const int,
-}
-
-impl Drop for r {
-    fn drop(&mut self) {
-        unsafe {
-            let _v2: Box<int> = mem::transmute(self.v);
-        }
-    }
-}
-
-fn r(v: *const int) -> r {
-    r {
-        v: v
-    }
-}
-
-fn main() {
-    unsafe {
-        let i1 = box 0i;
-        let i1p = mem::transmute_copy(&i1);
-        mem::forget(i1);
-        let x = box(GC) r(i1p);
-        failfn();
-        println!("{:?}", x);
-    }
-}
diff --git a/src/test/run-fail/unwind-box-str.rs b/src/test/run-fail/unwind-box-str.rs
deleted file mode 100644 (file)
index 07a8f5d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-extern crate debug;
-
-use std::gc::GC;
-
-fn failfn() {
-    fail!();
-}
-
-fn main() {
-    let x = box(GC) "hi".to_string();
-    failfn();
-    println!("{:?}", x);
-}
diff --git a/src/test/run-fail/unwind-box-unique-unique.rs b/src/test/run-fail/unwind-box-unique-unique.rs
deleted file mode 100644 (file)
index 9aa916a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-extern crate debug;
-
-use std::gc::GC;
-
-fn failfn() {
-    fail!();
-}
-
-fn main() {
-    let x = box(GC) box box 0i;
-    failfn();
-    println!("{:?}", x);
-}
diff --git a/src/test/run-fail/unwind-box-unique.rs b/src/test/run-fail/unwind-box-unique.rs
deleted file mode 100644 (file)
index 7135742..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-extern crate debug;
-
-use std::gc::GC;
-
-fn failfn() {
-    fail!();
-}
-
-fn main() {
-    let x = box(GC) box 0i;
-    failfn();
-    println!("{:?}", x);
-}
diff --git a/src/test/run-fail/unwind-box-vec.rs b/src/test/run-fail/unwind-box-vec.rs
deleted file mode 100644 (file)
index e7d1476..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-extern crate debug;
-
-use std::gc::GC;
-
-fn failfn() {
-    fail!();
-}
-
-fn main() {
-    let x = box(GC) vec!(0i, 1, 2, 3, 4, 5);
-    failfn();
-    println!("{:?}", x);
-}
diff --git a/src/test/run-fail/unwind-box.rs b/src/test/run-fail/unwind-box.rs
deleted file mode 100644 (file)
index 7d93ae5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn failfn() {
-    fail!();
-}
-
-fn main() {
-    box(GC) 0i;
-    failfn();
-}
diff --git a/src/test/run-fail/unwind-fail.rs b/src/test/run-fail/unwind-fail.rs
deleted file mode 100644 (file)
index 1e19522..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn main() {
-    box(GC) 0i;
-    fail!();
-}
diff --git a/src/test/run-fail/unwind-initializer-indirect.rs b/src/test/run-fail/unwind-initializer-indirect.rs
deleted file mode 100644 (file)
index 13ad5d2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::Gc;
-
-fn f() -> Gc<int> { fail!(); }
-
-fn main() {
-    let _a: Gc<int> = f();
-}
diff --git a/src/test/run-fail/unwind-initializer.rs b/src/test/run-fail/unwind-initializer.rs
deleted file mode 100644 (file)
index 7294b19..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::Gc;
-
-fn main() {
-    let _a: Gc<int> = {
-        fail!();
-    };
-}
diff --git a/src/test/run-fail/unwind-iter.rs b/src/test/run-fail/unwind-iter.rs
deleted file mode 100644 (file)
index 411b9a5..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-#![allow(unreachable_code)]
-#![allow(unused_variable)]
-
-use std::gc::GC;
-
-fn x(it: |int|) {
-    fail!();
-    it(0);
-}
-
-fn main() {
-    let a = box(GC) 0i;
-    x(|_i| { } );
-}
diff --git a/src/test/run-fail/unwind-iter2.rs b/src/test/run-fail/unwind-iter2.rs
deleted file mode 100644 (file)
index 1a2492e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::{GC};
-
-fn x(it: |int|) {
-    let _a = box(GC) 0i;
-    it(1);
-}
-
-fn main() {
-    x(|_x| fail!() );
-}
diff --git a/src/test/run-fail/unwind-lambda.rs b/src/test/run-fail/unwind-lambda.rs
deleted file mode 100644 (file)
index e96bc14..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::{Gc, GC};
-
-fn main() {
-    let cheese = "roquefort".to_string();
-    let carrots = box(GC) "crunchy".to_string();
-
-    let result: |Gc<String>, |String||: 'static = (|tasties, macerate| {
-        macerate((*tasties).clone());
-    });
-    result(carrots, |food| {
-        let mush = format!("{}{}", food, cheese);
-        let cheese = cheese.clone();
-        let f: || = || {
-            let _chew = format!("{}{}", mush, cheese);
-            fail!("so yummy")
-        };
-        f();
-    });
-}
diff --git a/src/test/run-fail/unwind-match.rs b/src/test/run-fail/unwind-match.rs
deleted file mode 100644 (file)
index a6564a6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Issue #945
-// error-pattern:non-exhaustive match failure
-
-
-use std::gc::GC;
-
-fn test_box() {
-    box(GC) 0i;
-}
-fn test_str() {
-  let res = match false { true => { "happy".to_string() },
-     _ => fail!("non-exhaustive match failure") };
-  assert_eq!(res, "happy".to_string());
-}
-fn main() {
-    test_box();
-    test_str();
-}
diff --git a/src/test/run-fail/unwind-misc-1.rs b/src/test/run-fail/unwind-misc-1.rs
deleted file mode 100644 (file)
index 23ec6cd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// exec-env:RUST_NEWRT=1
-// error-pattern:fail
-
-
-use std::vec;
-use std::collections;
-use std::gc::GC;
-
-fn main() {
-    let _count = box(GC) 0u;
-    let mut map = collections::HashMap::new();
-    let mut arr = Vec::new();
-    for _i in range(0u, 10u) {
-        arr.push(box(GC) "key stuff".to_string());
-        map.insert(arr.clone(),
-                   arr.clone().append([box(GC) "value stuff".to_string()]));
-        if arr.len() == 5 {
-            fail!();
-        }
-    }
-}
diff --git a/src/test/run-fail/unwind-move.rs b/src/test/run-fail/unwind-move.rs
deleted file mode 100644 (file)
index 692bf71..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::{Gc, GC};
-
-fn f(_a: Gc<int>) {
-    fail!();
-}
-
-fn main() {
-    let a = box(GC) 0;
-    f(a);
-}
diff --git a/src/test/run-fail/unwind-nested.rs b/src/test/run-fail/unwind-nested.rs
deleted file mode 100644 (file)
index 84b727e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn main() {
-    let _a = box(GC) 0i;
-    {
-        let _b = box(GC) 0i;
-        {
-            fail!();
-        }
-    }
-}
diff --git a/src/test/run-fail/unwind-partial-box.rs b/src/test/run-fail/unwind-partial-box.rs
deleted file mode 100644 (file)
index 366531b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn f() -> Vec<int> { fail!(); }
-
-// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
-// have been to do with memory allocation patterns.
-fn prime() {
-    box(GC) 0i;
-}
-
-fn partial() {
-    let _x = box(GC) f();
-}
-
-fn main() {
-    prime();
-    partial();
-}
diff --git a/src/test/run-fail/unwind-partial-unique.rs b/src/test/run-fail/unwind-partial-unique.rs
deleted file mode 100644 (file)
index 725b57a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn f() -> Vec<int> { fail!(); }
-
-// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
-// have been to do with memory allocation patterns.
-fn prime() {
-    box(GC) 0i;
-}
-
-fn partial() {
-    let _x = box f();
-}
-
-fn main() {
-    prime();
-    partial();
-}
diff --git a/src/test/run-fail/unwind-partial-vec.rs b/src/test/run-fail/unwind-partial-vec.rs
deleted file mode 100644 (file)
index 627fb3d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn f() -> Vec<int> { fail!(); }
-
-// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
-// have been to do with memory allocation patterns.
-fn prime() {
-    box(GC) 0i;
-}
-
-fn partial() {
-    let _x = vec!(vec!(0i), f(), vec!(0i));
-}
-
-fn main() {
-    prime();
-    partial();
-}
diff --git a/src/test/run-fail/unwind-resource-fail.rs b/src/test/run-fail/unwind-resource-fail.rs
deleted file mode 100644 (file)
index 66fd044..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-// error-pattern:squirrel
-
-use std::gc::GC;
-
-struct r {
-    i: int,
-}
-
-impl Drop for r {
-    fn drop(&mut self) { fail!("squirrel") }
-}
-
-fn r(i: int) -> r { r { i: i } }
-
-fn main() {
-    box(GC) 0i;
-    let _r = r(0);
-}
diff --git a/src/test/run-fail/unwind-resource-fail2.rs b/src/test/run-fail/unwind-resource-fail2.rs
deleted file mode 100644 (file)
index add7fe3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-test leaks
-// error-pattern:wombat
-
-use std::gc::GC;
-
-struct r {
-    i: int,
-}
-
-impl Drop for r {
-    fn drop(&mut self) { fail!("wombat") }
-}
-
-fn r(i: int) -> r { r { i: i } }
-
-fn main() {
-    box(GC) 0;
-    let r = r(0);
-    fail!();
-}
diff --git a/src/test/run-fail/unwind-resource-fail3.rs b/src/test/run-fail/unwind-resource-fail3.rs
deleted file mode 100644 (file)
index 9ec7c4a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(unsafe_destructor)]
-
-// error-pattern:quux
-
-use std::gc::{Gc, GC};
-
-struct faily_box {
-    i: Gc<int>
-}
-// What happens to the box pointer owned by this class?
-
-fn faily_box(i: Gc<int>) -> faily_box { faily_box { i: i } }
-
-#[unsafe_destructor]
-impl Drop for faily_box {
-    fn drop(&mut self) {
-        fail!("quux");
-    }
-}
-
-fn main() {
-    faily_box(box(GC) 10);
-}
diff --git a/src/test/run-fail/unwind-stacked.rs b/src/test/run-fail/unwind-stacked.rs
deleted file mode 100644 (file)
index 1e1caac..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn f() {
-    let _a = box(GC) 0i;
-    fail!();
-}
-
-fn g() {
-    let _b = box(GC) 0i;
-    f();
-}
-
-fn main() {
-    let _a = box(GC) 0i;
-    g();
-}
diff --git a/src/test/run-fail/unwind-tup.rs b/src/test/run-fail/unwind-tup.rs
deleted file mode 100644 (file)
index 877e2be..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::Gc;
-
-// error-pattern:fail
-
-fn fold_local() -> Gc<Vec<int>> {
-    fail!();
-}
-
-fn main() {
-    let _lss = (fold_local(), 0i);
-}
diff --git a/src/test/run-fail/unwind-tup2.rs b/src/test/run-fail/unwind-tup2.rs
deleted file mode 100644 (file)
index 0153623..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-// error-pattern:fail
-
-fn fold_local() -> Gc<Vec<int>> {
-    box(GC) vec!(0,0,0,0,0,0)
-}
-
-fn fold_remote() -> Gc<Vec<int>> {
-    fail!();
-}
-
-fn main() {
-    let _lss = (fold_local(), fold_remote());
-}
diff --git a/src/test/run-fail/unwind-uninitialized.rs b/src/test/run-fail/unwind-uninitialized.rs
deleted file mode 100644 (file)
index 54321e9..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:fail
-
-
-use std::gc::GC;
-
-fn f() {
-    fail!();
-}
-
-fn main() {
-    f();
-    let _a = box(GC) 0i;
-}
index 7cc4fab999c2d6d4476a28ff63566c44f7d13beb..49a374f343c6fa27e2ad03b98c886d2463940bb6 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 #[deriving(PartialEq, Show)]
 struct Point { x : int }
 
@@ -19,5 +17,4 @@ pub fn main() {
     assert_eq!("abc".to_string(),"abc".to_string());
     assert_eq!(box Point{x:34},box Point{x:34});
     assert_eq!(&Point{x:34},&Point{x:34});
-    assert_eq!(box(GC) Point{x:34},box(GC) Point{x:34});
 }
index 2bad924192f78edaf27fa28e82e63c2b17cb347e..cc4dd13cf61c9c715fa3c75e4b9775313ee87f75 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::{GC, Gc};
-
 trait double {
     fn double(self) -> uint;
 }
@@ -19,11 +17,11 @@ impl double for uint {
     fn double(self) -> uint { self }
 }
 
-impl double for Gc<uint> {
+impl double for Box<uint> {
     fn double(self) -> uint { *self * 2u }
 }
 
 pub fn main() {
-    let x = box(GC) 3u;
+    let x = box 3u;
     assert_eq!(x.double(), 6u);
 }
index ac19c373bb201f0a64b56157c8ee43342893d143..7f44bcdb50c1a328e57751b55a85a3c3bea24cb8 100644 (file)
@@ -9,15 +9,13 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
-
 trait Foo {
     fn foo(&self) -> String;
 }
 
-impl<T:Foo> Foo for Gc<T> {
+impl<T:Foo> Foo for Box<T> {
     fn foo(&self) -> String {
-        format!("box(GC) {}", (**self).foo())
+        format!("box {}", (**self).foo())
     }
 }
 
@@ -28,6 +26,6 @@ fn foo(&self) -> String {
 }
 
 pub fn main() {
-    let x = box(GC) 3u;
-    assert_eq!(x.foo(), "box(GC) 3".to_string());
+    let x = box 3u;
+    assert_eq!(x.foo(), "box 3".to_string());
 }
index 2551dafe345ce74a0ab650562e3c680daf32f7f9..3997c5d3d29b82e7ef051f873c7ae6752494b781 100644 (file)
@@ -10,9 +10,6 @@
 
 // Binop corner cases
 
-
-use std::gc::GC;
-
 fn test_nil() {
     assert_eq!((), ());
     assert!((!(() != ())));
@@ -45,10 +42,6 @@ fn test_bool() {
     assert_eq!(true ^ true, false);
 }
 
-fn test_box() {
-    assert_eq!(box(GC) 10i, box(GC) 10i);
-}
-
 fn test_ptr() {
     unsafe {
         let p1: *const u8 = ::std::mem::transmute(0u);
@@ -98,7 +91,6 @@ fn test_class() {
 pub fn main() {
     test_nil();
     test_bool();
-    test_box();
     test_ptr();
     test_class();
 }
index 7222d655a408f2b3d72bb4eaf8cf3f697ac9e4c3..8c4995e710097b24366935a4c40cebf718c771e4 100644 (file)
@@ -9,13 +9,11 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
-
 fn borrow(x: &int, f: |x: &int|) {
     f(x)
 }
 
-fn test1(x: Gc<Box<int>>) {
+fn test1(x: &Box<int>) {
     borrow(&*(*x).clone(), |p| {
         let x_a = &**x as *const int;
         assert!((x_a as uint) != (p as *const int as uint));
@@ -24,5 +22,5 @@ fn test1(x: Gc<Box<int>>) {
 }
 
 pub fn main() {
-    test1(box(GC) box 22);
+    test1(&box 22);
 }
diff --git a/src/test/run-pass/borrowck-preserve-box-in-moved-value.rs b/src/test/run-pass/borrowck-preserve-box-in-moved-value.rs
deleted file mode 100644 (file)
index 525a93a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// exec-env:RUST_POISON_ON_FREE=1
-
-// Test that we root `x` even though it is found in immutable memory,
-// because it is moved.
-
-
-use std::gc::{Gc, GC};
-
-fn free<T>(x: Gc<T>) {}
-
-struct Foo {
-    f: Gc<Bar>
-}
-
-struct Bar {
-    g: int
-}
-
-fn lend(x: Gc<Foo>) -> int {
-    let y = &x.f.g;
-    free(x); // specifically here, if x is not rooted, it will be freed
-    *y
-}
-
-pub fn main() {
-    assert_eq!(lend(box(GC) Foo {f: box(GC) Bar {g: 22}}), 22);
-}
diff --git a/src/test/run-pass/borrowck-root-while-cond-2.rs b/src/test/run-pass/borrowck-root-while-cond-2.rs
deleted file mode 100644 (file)
index 3448675..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{GC, Gc};
-
-struct F { f: Gc<G> }
-struct G { g: Vec<int> }
-
-pub fn main() {
-    let rec = box(GC) F {f: box(GC) G {g: vec!(1, 2, 3)}};
-    while rec.f.g.len() == 23 {}
-}
diff --git a/src/test/run-pass/borrowck-root-while-cond.rs b/src/test/run-pass/borrowck-root-while-cond.rs
deleted file mode 100644 (file)
index 163ccf5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-fn borrow<'r,T>(x: &'r T) -> &'r T {x}
-
-struct Rec { f: Gc<int> }
-
-pub fn main() {
-    let rec = box(GC) Rec {f: box(GC) 22};
-    while *borrow(&*rec.f) == 23 {}
-}
index 8192566da19656c5c22f59232fc1bf646efbcc1a..129fa8bf7d926f7a6449021ed14d76a5463b5c2a 100644 (file)
@@ -10,7 +10,6 @@
 
 
 use std::cell::Cell;
-use std::gc::GC;
 
 enum newtype {
     newvar(int)
@@ -21,8 +20,8 @@ pub fn main() {
     // Test that borrowck treats enums with a single variant
     // specially.
 
-    let x = box(GC) Cell::new(5);
-    let y = box(GC) Cell::new(newvar(3));
+    let x = &Cell::new(5);
+    let y = &Cell::new(newvar(3));
     let z = match y.get() {
       newvar(b) => {
         x.set(x.get() + 1);
diff --git a/src/test/run-pass/box-compare.rs b/src/test/run-pass/box-compare.rs
deleted file mode 100644 (file)
index 9e8e416..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::GC;
-
-pub fn main() {
-    assert!((box(GC) 1i < box(GC) 3i));
-    assert!((box(GC) box(GC) "hello ".to_string() >
-             box(GC) box(GC) "hello".to_string()));
-    assert!((box(GC) box(GC) box(GC) "hello".to_string() !=
-             box(GC) box(GC) box(GC) "there".to_string()));
-}
diff --git a/src/test/run-pass/box-in-tup.rs b/src/test/run-pass/box-in-tup.rs
deleted file mode 100644 (file)
index 8d7bb55..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-pub fn main() {
-    let i: (Gc<int>, int) = (box(GC) 10, 10);
-    let (_a, _) = i;
-}
diff --git a/src/test/run-pass/box-inside-if.rs b/src/test/run-pass/box-inside-if.rs
deleted file mode 100644 (file)
index 47c7e7f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{GC, Gc};
-
-fn some_box(x: int) -> Gc<int> { return box(GC) x; }
-
-fn is_odd(_n: int) -> bool { return true; }
-
-fn length_is_even(_vs: Gc<int>) -> bool { return true; }
-
-fn foo(_acc: int, n: int) {
-    if is_odd(n) && length_is_even(some_box(1)) { println!("bloop"); }
-}
-
-pub fn main() { foo(67, 5); }
diff --git a/src/test/run-pass/box-inside-if2.rs b/src/test/run-pass/box-inside-if2.rs
deleted file mode 100644 (file)
index e62050c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-fn some_box(x: int) -> Gc<int> { return box(GC) x; }
-
-fn is_odd(_n: int) -> bool { return true; }
-
-fn length_is_even(_vs: Gc<int>) -> bool { return true; }
-
-fn foo(_acc: int, n: int) {
-    if is_odd(n) || length_is_even(some_box(1)) { println!("bloop"); }
-}
-
-pub fn main() { foo(67, 5); }
diff --git a/src/test/run-pass/box-pattern.rs b/src/test/run-pass/box-pattern.rs
deleted file mode 100644 (file)
index 21d1d23..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
-    let box x = box 3i;
-    match box 3i {
-        box y => {
-            assert!(x == y);
-            println!("{} {}", x, y);
-        }
-    }
-}
-
diff --git a/src/test/run-pass/box-unbox.rs b/src/test/run-pass/box-unbox.rs
deleted file mode 100644 (file)
index bc8afff..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-struct Box<T> {c: Gc<T>}
-
-fn unbox<T:Clone>(b: Box<T>) -> T { return (*b.c).clone(); }
-
-pub fn main() {
-    let foo: int = 17;
-    let bfoo: Box<int> = Box {c: box(GC) foo};
-    println!("see what's in our box");
-    assert_eq!(unbox::<int>(bfoo), foo);
-}
diff --git a/src/test/run-pass/box.rs b/src/test/run-pass/box.rs
deleted file mode 100644 (file)
index 844b939..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-pub fn main() { let x: Gc<int> = box(GC) 10; assert!((*x == 10)); }
diff --git a/src/test/run-pass/boxed-class-type-substitution.rs b/src/test/run-pass/boxed-class-type-substitution.rs
deleted file mode 100644 (file)
index 41ffdd7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Regression test that rustc doesn't recurse infinitely substituting
-// the boxed type parameter
-
-
-use std::gc::Gc;
-
-struct Tree<T> {
-    parent: Option<T>
-}
-
-fn empty<T>() -> Tree<T> { fail!() }
-
-struct Box {
-    tree: Tree<Gc<Box>>
-}
-
-fn Box() -> Box {
-    Box {
-        tree: empty()
-    }
-}
-
-struct LayoutData {
-    a_box: Option<Gc<Box>>
-}
-
-pub fn main() { }
index e319866d5ce73c7a3442c15501894ccf5f846390..262c19174b18b9edd5f33d16520e59f7e4ea12da 100644 (file)
 
 extern crate cci_borrow_lib;
 use cci_borrow_lib::foo;
-use std::gc::GC;
 
 pub fn main() {
-    let p = box(GC) 22u;
+    let p = box 22u;
     let r = foo(&*p);
     println!("r={}", r);
     assert_eq!(r, 22u);
index 099431acd246c5af40f5c02f667c668b62845c21..a54a821a7b9b47bef62c3551c9b3580362a0d3a8 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 struct kitten {
     cat: Option<cat>,
 }
@@ -21,6 +19,6 @@ fn kitten(cat: Option<cat>) -> kitten {
     }
 }
 
-type cat = Gc<kitten>;
+type cat = Box<kitten>;
 
 pub fn main() {}
diff --git a/src/test/run-pass/cleanup-copy-mode.rs b/src/test/run-pass/cleanup-copy-mode.rs
deleted file mode 100644 (file)
index 3eec506..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::task;
-use std::gc::{GC, Gc};
-
-fn adder(x: Gc<int>, y: Gc<int>) -> int { return *x + *y; }
-fn failer() -> Gc<int> { fail!(); }
-pub fn main() {
-    assert!(task::try(proc() {
-        adder(box(GC) 2, failer()); ()
-    }).is_err());
-}
index 481a922a463f0abb9631e408f39fcf5599229527..0088a36eda9a3239019c73e0281eee4d8b1ad0d1 100644 (file)
 
 extern crate crate_method_reexport_grrrrrrr2;
 
-use std::gc::GC;
-
 pub fn main() {
     use crate_method_reexport_grrrrrrr2::rust::add;
     use crate_method_reexport_grrrrrrr2::rust::cx;
-    let x = box(GC) ();
+    let x = box() ();
     x.cx();
     let y = ();
     y.add("hi".to_string());
diff --git a/src/test/run-pass/cycle-collection.rs b/src/test/run-pass/cycle-collection.rs
deleted file mode 100644 (file)
index edcbd21..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::cell::RefCell;
-use std::gc::{Gc, GC};
-
-enum taggy {
-    cons(Gc<RefCell<taggy>>),
-    nil,
-}
-
-fn f() {
-    let a_box = box(GC) RefCell::new(nil);
-    *a_box.borrow_mut() = cons(a_box);
-}
-
-pub fn main() {
-    f();
-}
index 4ccf6744d5c003da09a54777dd96881a827f8886..d9b0940f80b3f328a745ba984ad29ee100ff94b6 100644 (file)
@@ -9,13 +9,10 @@
 // except according to those terms.
 
 
-extern crate debug;
-
 use std::cell::Cell;
-use std::gc::GC;
 
 pub fn main() {
-    let x = box(GC) Cell::new(5i);
+    let x = box Cell::new(5i);
     x.set(1000i);
-    println!("{:?}", x.get());
+    println!("{}", x.get());
 }
index 12fc65cecb9434a6ddec35e11b426c999cd62443..117b133a11319fcc55c2dd02a8006e14c2eca9fa 100644 (file)
@@ -9,9 +9,7 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
-
 pub fn main() {
-    let x: Gc<int> = box(GC) 10;
+    let x: Box<int> = box 10;
     let _y: int = *x;
 }
diff --git a/src/test/run-pass/double-unbox.rs b/src/test/run-pass/double-unbox.rs
deleted file mode 100644 (file)
index 0d5556a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::Gc;
-
-struct Quux {
-    bar: int
-}
-
-fn g(_i: int) { }
-fn f(foo: Gc<Gc<Quux>>) { g(foo.bar); }
-
-pub fn main() { }
index 8add96d8ed7bc87cad4787bd4e2123fde58eb0f3..c52549d286fd5bc44e6123a8910bc6ff27e5b7ad 100644 (file)
@@ -9,11 +9,9 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
-
-enum t { foo(Gc<int>), }
+enum t { foo(Box<int>), }
 
 pub fn main() {
-    let tt = foo(box(GC) 10);
+    let tt = foo(box 10);
     match tt { foo(_z) => { } }
 }
index 433c3b54224735d4c59a758dbbc5c688d06ba5c5..3e22c8331839306de32446ae5827da8fb4910f27 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
 use std::mem::size_of;
 
 trait Trait {}
@@ -33,9 +32,8 @@ fn main() {
     assert_eq!(size_of::<&Trait>(), size_of::<Option<&Trait>>());
     assert_eq!(size_of::<&mut Trait>(), size_of::<Option<&mut Trait>>());
 
-    // Pointers - Box<T> / Gc<T>
+    // Pointers - Box<T>
     assert_eq!(size_of::<Box<int>>(), size_of::<Option<Box<int>>>());
-    assert_eq!(size_of::<Gc<int>>(), size_of::<Option<Gc<int>>>());
 
 
     // The optimization can't apply to raw pointers
index 7d8a3d3fb7965675b06bb00529643346b590e4bf..24fb503aea3a96ebf549fe9892d789aa0f1272a1 100644 (file)
  * represented with nullable pointers could be misoptimized in some cases.
  */
 
-use std::gc::{Gc, GC};
-
-enum List<X> { Nil, Cons(X, Gc<List<X>>) }
+enum List<X> { Nil, Cons(X, Box<List<X>>) }
 pub fn main() {
-    match Cons(10i, box(GC) Nil) {
+    match Cons(10i, box Nil) {
         Cons(10i, _) => {}
         Nil => {}
         _ => fail!()
diff --git a/src/test/run-pass/evec-internal-boxes.rs b/src/test/run-pass/evec-internal-boxes.rs
deleted file mode 100644 (file)
index 63e034c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(dead_assignment)]
-
-use std::gc::{Gc, GC};
-
-pub fn main() {
-    let x : [Gc<int>, ..5] = [box(GC) 1,box(GC) 2,box(GC) 3,box(GC) 4,box(GC) 5];
-    let _y : [Gc<int>, ..5] = [box(GC) 1,box(GC) 2,box(GC) 3,box(GC) 4,box(GC) 5];
-    let mut z = [box(GC) 1,box(GC) 2,box(GC) 3,box(GC) 4,box(GC) 5];
-    z = x;
-    assert_eq!(*z[0], 1);
-    assert_eq!(*z[4], 5);
-}
index 424a09227ec0e23bfa1a51ca8f55c92b499e0760..94652e30fe64f2ac86fd1419607c1bc114b35610 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
-enum list_cell<T> { cons(Gc<list_cell<T>>), nil }
+enum list_cell<T> { cons(Box<list_cell<T>>), nil }
 
 pub fn main() { }
diff --git a/src/test/run-pass/expr-block-box.rs b/src/test/run-pass/expr-block-box.rs
deleted file mode 100644 (file)
index 9b3d202..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::GC;
-
-pub fn main() { let x = { box(GC) 100i }; assert!((*x == 100)); }
diff --git a/src/test/run-pass/expr-block-generic-box1.rs b/src/test/run-pass/expr-block-generic-box1.rs
deleted file mode 100644 (file)
index dfcef17..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-type compare<T> = |Gc<T>, Gc<T>|: 'static -> bool;
-
-fn test_generic<T>(expected: Gc<T>, eq: compare<T>) {
-    let actual: Gc<T> = { expected };
-    assert!((eq(expected, actual)));
-}
-
-fn test_box() {
-    fn compare_box(b1: Gc<bool>, b2: Gc<bool>) -> bool {
-        println!("{}", *b1);
-        println!("{}", *b2);
-        return *b1 == *b2;
-    }
-    test_generic::<bool>(box(GC) true, compare_box);
-}
-
-pub fn main() { test_box(); }
diff --git a/src/test/run-pass/expr-block-generic-box2.rs b/src/test/run-pass/expr-block-generic-box2.rs
deleted file mode 100644 (file)
index 547e7df..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{GC, Gc};
-
-type compare<'a, T> = |T, T|: 'a -> bool;
-
-fn test_generic<T:Clone>(expected: T, eq: compare<T>) {
-    let actual: T = { expected.clone() };
-    assert!((eq(expected, actual)));
-}
-
-fn test_vec() {
-    fn compare_vec(v1: Gc<int>, v2: Gc<int>) -> bool { return v1 == v2; }
-    test_generic::<Gc<int>>(box(GC) 1, compare_vec);
-}
-
-pub fn main() { test_vec(); }
diff --git a/src/test/run-pass/expr-block-ref.rs b/src/test/run-pass/expr-block-ref.rs
deleted file mode 100644 (file)
index 3d649b1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::GC;
-
-// Regression test for issue #388
-pub fn main() { let _x = { { box(GC) 10i } }; }
diff --git a/src/test/run-pass/expr-elseif-ref.rs b/src/test/run-pass/expr-elseif-ref.rs
deleted file mode 100644 (file)
index f0b9c85..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-// Make sure we drop the refs of the temporaries needed to return the
-// values from the else if branch
-pub fn main() {
-    let y: Gc<uint> = box(GC) 10u;
-    let _x = if false { y } else if true { y } else { y };
-    assert_eq!(*y, 10u);
-}
diff --git a/src/test/run-pass/expr-elseif-ref2.rs b/src/test/run-pass/expr-elseif-ref2.rs
deleted file mode 100644 (file)
index 9d4efea..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{GC};
-
-// Regression test for issue #388
-pub fn main() {
-    let _x = if false {
-        box(GC) 0u
-    } else if true {
-        box(GC) 10u
-    } else {
-        box(GC) 0u
-    };
-}
diff --git a/src/test/run-pass/expr-if-box.rs b/src/test/run-pass/expr-if-box.rs
deleted file mode 100644 (file)
index 3def457..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-// Tests for if as expressions returning boxed types
-fn test_box() {
-    let rs = if true { box(GC) 100i } else { box(GC) 101i };
-    assert_eq!(*rs, 100);
-}
-
-fn test_str() {
-    let rs = if true { "happy".to_string() } else { "sad".to_string() };
-    assert_eq!(rs, "happy".to_string());
-}
-
-pub fn main() { test_box(); test_str(); }
diff --git a/src/test/run-pass/expr-if-generic-box1.rs b/src/test/run-pass/expr-if-generic-box1.rs
deleted file mode 100644 (file)
index 931f500..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{GC, Gc};
-
-type compare<T> = |Gc<T>, Gc<T>|: 'static -> bool;
-
-fn test_generic<T>(expected: Gc<T>, not_expected: Gc<T>, eq: compare<T>) {
-    let actual: Gc<T> = if true { expected } else { not_expected };
-    assert!((eq(expected, actual)));
-}
-
-fn test_box() {
-    fn compare_box(b1: Gc<bool>, b2: Gc<bool>) -> bool { return *b1 == *b2; }
-    test_generic::<bool>(box(GC) true, box(GC) false, compare_box);
-}
-
-pub fn main() { test_box(); }
diff --git a/src/test/run-pass/expr-if-generic-box2.rs b/src/test/run-pass/expr-if-generic-box2.rs
deleted file mode 100644 (file)
index b8b8c9b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-type compare<T> = |T, T|: 'static -> bool;
-
-fn test_generic<T:Clone>(expected: T, not_expected: T, eq: compare<T>) {
-    let actual: T = if true { expected.clone() } else { not_expected };
-    assert!((eq(expected, actual)));
-}
-
-fn test_vec() {
-    fn compare_box(v1: Gc<int>, v2: Gc<int>) -> bool { return v1 == v2; }
-    test_generic::<Gc<int>>(box(GC) 1, box(GC) 2, compare_box);
-}
-
-pub fn main() { test_vec(); }
diff --git a/src/test/run-pass/expr-match-box.rs b/src/test/run-pass/expr-match-box.rs
deleted file mode 100644 (file)
index c2ba360..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::GC;
-
-// Tests for match as expressions resulting in boxed types
-fn test_box() {
-    let res = match true { true => { box(GC) 100i } _ => fail!("wat") };
-    assert_eq!(*res, 100i);
-}
-
-fn test_str() {
-    let res = match true { true => { "happy".to_string() },
-                         _ => fail!("not happy at all") };
-    assert_eq!(res, "happy".to_string());
-}
-
-pub fn main() { test_box(); test_str(); }
diff --git a/src/test/run-pass/expr-match-generic-box1.rs b/src/test/run-pass/expr-match-generic-box1.rs
deleted file mode 100644 (file)
index 97fa53b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-type compare<T> = |Gc<T>, Gc<T>|: 'static -> bool;
-
-fn test_generic<T>(expected: Gc<T>, eq: compare<T>) {
-    let actual: Gc<T> = match true { true => { expected }, _ => fail!() };
-    assert!((eq(expected, actual)));
-}
-
-fn test_box() {
-    fn compare_box(b1: Gc<bool>, b2: Gc<bool>) -> bool { return *b1 == *b2; }
-    test_generic::<bool>(box(GC) true, compare_box);
-}
-
-pub fn main() { test_box(); }
diff --git a/src/test/run-pass/expr-match-generic-box2.rs b/src/test/run-pass/expr-match-generic-box2.rs
deleted file mode 100644 (file)
index fd8179c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-type compare<T> = |T, T|: 'static -> bool;
-
-fn test_generic<T:Clone>(expected: T, eq: compare<T>) {
-    let actual: T = match true { true => { expected.clone() }, _ => fail!("wat") };
-    assert!((eq(expected, actual)));
-}
-
-fn test_vec() {
-    fn compare_box(v1: Gc<int>, v2: Gc<int>) -> bool { return v1 == v2; }
-    test_generic::<Gc<int>>(box(GC) 1, compare_box);
-}
-
-pub fn main() { test_vec(); }
index cd0f3d6101a9c63d7dbf8979869b112ef041538f..e95c2034131552beed85a747b442bbac4233dfa2 100644 (file)
 
 
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
 struct Point {x: int, y: int, z: int}
 
-fn f(p: Gc<Cell<Point>>) {
+fn f(p: &Cell<Point>) {
     assert!((p.get().z == 12));
     p.set(Point {x: 10, y: 11, z: 13});
     assert!((p.get().z == 13));
@@ -22,7 +21,7 @@ fn f(p: Gc<Cell<Point>>) {
 
 pub fn main() {
     let a: Point = Point {x: 10, y: 11, z: 12};
-    let b: Gc<Cell<Point>> = box(GC) Cell::new(a);
+    let b: &Cell<Point> = &Cell::new(a);
     assert_eq!(b.get().z, 12);
     f(b);
     assert_eq!(a.z, 12);
index 835f1fe4d4a80dcf33711d25343ce66cf108b7fd..3faa30c4c8a20e896e0d17e594bdfdffedea91c0 100644 (file)
@@ -9,45 +9,25 @@
 // except according to those terms.
 
 use std::task;
-use std::gc::{GC, Gc};
-use std::cell::RefCell;
 
 static mut DROPS: uint = 0;
 
-struct Foo(bool);
+struct Foo;
 impl Drop for Foo {
     fn drop(&mut self) {
-        let Foo(fail) = *self;
         unsafe { DROPS += 1; }
-        if fail { fail!() }
+        fail!()
     }
 }
 
-fn tld_fail(fail: bool) {
-    local_data_key!(foo: Foo);
-    foo.replace(Some(Foo(fail)));
-}
-
-fn gc_fail(fail: bool) {
-    struct A {
-        inner: RefCell<Option<Gc<A>>>,
-        other: Foo,
-    }
-    let a = box(GC) A {
-        inner: RefCell::new(None),
-        other: Foo(fail),
-    };
-    *a.inner.borrow_mut() = Some(a.clone());
-}
-
 fn main() {
     let _ = task::try(proc() {
-        tld_fail(true);
-        gc_fail(false);
+        local_data_key!(foo: Foo);
+        foo.replace(Some(Foo));
     });
 
     unsafe {
-        assert_eq!(DROPS, 2);
+        assert_eq!(DROPS, 1);
     }
 }
 
diff --git a/src/test/run-pass/gc-vec.rs b/src/test/run-pass/gc-vec.rs
deleted file mode 100644 (file)
index 430ee16..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::gc::{GC};
-
-fn main() {
-    // A fixed-size array allocated in a garbage-collected box
-    let x = box(GC) [1i, 2, 3, 4, 5, 6, 7, 8, 9, 10];
-    assert_eq!(x[0], 1);
-    assert_eq!(x[6], 7);
-    assert_eq!(x[9], 10);
-
-    let y = x;
-    assert!(*y == [1i, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
-}
diff --git a/src/test/run-pass/generic-alias-box.rs b/src/test/run-pass/generic-alias-box.rs
deleted file mode 100644 (file)
index 325f6a2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-extern crate debug;
-
-use std::gc::{Gc, GC};
-
-fn id<T>(t: T) -> T { return t; }
-
-pub fn main() {
-    let expected = box(GC) 100;
-    let actual = id::<Gc<int>>(expected);
-    println!("{:?}", *actual);
-    assert_eq!(*expected, *actual);
-}
diff --git a/src/test/run-pass/generic-box.rs b/src/test/run-pass/generic-box.rs
deleted file mode 100644 (file)
index d5047eb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-fn box_it<T:'static>(x: Box<T>) -> Gc<Box<T>> { return box(GC) x; }
-
-struct Box<T> {x: T, y: T, z: T}
-
-pub fn main() {
-    let x: Gc<Box<int>> = box_it::<int>(Box{x: 1, y: 2, z: 3});
-    assert_eq!(x.y, 2);
-}
diff --git a/src/test/run-pass/generic-drop-glue.rs b/src/test/run-pass/generic-drop-glue.rs
deleted file mode 100644 (file)
index 2cc3a89..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-struct Pair { x: Gc<int>, y: Gc<int> }
-
-fn f<T>(t: T) { let _t1: T = t; }
-
-pub fn main() { let x = Pair {x: box(GC) 10, y: box(GC) 12}; f(x); }
diff --git a/src/test/run-pass/generic-exterior-box.rs b/src/test/run-pass/generic-exterior-box.rs
deleted file mode 100644 (file)
index 2c1ae5d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-struct Recbox<T> {x: Gc<T>}
-
-fn reclift<T:'static>(t: T) -> Recbox<T> { return Recbox {x: box(GC) t}; }
-
-pub fn main() {
-    let foo: int = 17;
-    let rbfoo: Recbox<int> = reclift::<int>(foo);
-    assert_eq!(*rbfoo.x, foo);
-}
diff --git a/src/test/run-pass/generic-fn-box.rs b/src/test/run-pass/generic-fn-box.rs
deleted file mode 100644 (file)
index 2164b00..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-extern crate debug;
-
-use std::gc::{Gc, GC};
-
-fn f<T>(x: Gc<T>) -> Gc<T> { return x; }
-
-pub fn main() { let x = f(box(GC) 3i); println!("{:?}", *x); }
diff --git a/src/test/run-pass/generic-ivec.rs b/src/test/run-pass/generic-ivec.rs
deleted file mode 100644 (file)
index 68e7b98..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-fn f<T>(_v: Gc<T>) { }
-pub fn main() { f(box(GC) vec!(1i, 2, 3, 4, 5)); }
index 6d81cea8b2fcf82b1e70033d28db7e304a7dd010..d8777515cecf05e510ba1c89f8684d17d3c5b257 100644 (file)
 // ignore-pretty FIXME(#14193)
 
 
-use std::gc::{Gc, GC};
-
-enum list<T> { cons(Gc<T>, Gc<list<T>>), nil, }
+enum list<T> { cons(Box<T>, Box<list<T>>), nil, }
 
 pub fn main() {
     let _a: list<int> =
-        cons::<int>(box(GC) 10,
-        box(GC) cons::<int>(box(GC) 12,
-        box(GC) cons::<int>(box(GC) 13,
-        box(GC) nil::<int>)));
+        cons::<int>(box 10,
+        box cons::<int>(box 12,
+        box cons::<int>(box 13,
+        box nil::<int>)));
 }
index 43cdf43ceb3548809e1b77e4437074e7e31ff8e4..52e512e515c589cd311ec59f29b0a0c72b0fc68b 100644 (file)
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 
-use std::gc::{Gc, GC};
-
-enum option<T> { some(Gc<T>), none, }
+enum option<T> { some(Box<T>), none, }
 
 pub fn main() {
-    let mut a: option<int> = some::<int>(box(GC) 10);
+    let mut a: option<int> = some::<int>(box 10);
     a = none::<int>;
 }
index 78e17bb22bd0315c85abb1467a58adeb39efceb1..365070f704f8541efa68390296809412658b8741 100644 (file)
@@ -18,7 +18,6 @@
 extern crate debug;
 
 use std::fmt;
-use std::gc::GC;
 use std::io::MemWriter;
 use std::io;
 use std::str;
@@ -50,7 +49,6 @@ pub fn main() {
     t!(format!("{:?}", 1i), "1");
     t!(format!("{:?}", A), "A");
     t!(format!("{:?}", ()), "()");
-    t!(format!("{:?}", box(GC) (box 1i, "foo")), "box(GC) (box 1, \"foo\")");
 
     // Various edge cases without formats
     t!(format!(""), "");
index d6920b2e2fe80e6beb06c607c4616e365d82a259..752e95f25dc5315d1fdc8664efbf2247c11a4c92 100644 (file)
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
 // Resources can't be copied, but storing into data structures counts
 // as a move unless the stored thing is used afterwards.
 
-struct r {
-    i: Gc<Cell<int>>,
+struct r<'a> {
+    i: &'a Cell<int>,
 }
 
-struct Box { x: r }
+struct BoxR<'a> { x: r<'a> }
 
 #[unsafe_destructor]
-impl Drop for r {
+impl<'a> Drop for r<'a> {
     fn drop(&mut self) {
         self.i.set(self.i.get() + 1)
     }
 }
 
-fn r(i: Gc<Cell<int>>) -> r {
+fn r(i: &Cell<int>) -> r {
     r {
         i: i
     }
 }
 
-fn test_box() {
-    let i = box(GC) Cell::new(0i);
-    {
-        let _a = box(GC) r(i);
-    }
-    assert_eq!(i.get(), 1);
-}
-
 fn test_rec() {
-    let i = box(GC) Cell::new(0i);
+    let i = &Cell::new(0i);
     {
-        let _a = Box {x: r(i)};
+        let _a = BoxR {x: r(i)};
     }
     assert_eq!(i.get(), 1);
 }
 
 fn test_tag() {
-    enum t {
-        t0(r),
+    enum t<'a> {
+        t0(r<'a>),
     }
 
-    let i = box(GC) Cell::new(0i);
+    let i = &Cell::new(0i);
     {
         let _a = t0(r(i));
     }
@@ -64,7 +55,7 @@ enum t {
 }
 
 fn test_tup() {
-    let i = box(GC) Cell::new(0i);
+    let i = &Cell::new(0i);
     {
         let _a = (r(i), 0i);
     }
@@ -72,17 +63,17 @@ fn test_tup() {
 }
 
 fn test_unique() {
-    let i = box(GC) Cell::new(0i);
+    let i = &Cell::new(0i);
     {
         let _a = box r(i);
     }
     assert_eq!(i.get(), 1);
 }
 
-fn test_box_rec() {
-    let i = box(GC) Cell::new(0i);
+fn test_unique_rec() {
+    let i = &Cell::new(0i);
     {
-        let _a = box(GC) Box {
+        let _a = box BoxR {
             x: r(i)
         };
     }
@@ -90,10 +81,9 @@ fn test_box_rec() {
 }
 
 pub fn main() {
-    test_box();
     test_rec();
     test_tag();
     test_tup();
     test_unique();
-    test_box_rec();
+    test_unique_rec();
 }
index 9aff6b917484e7b12c811f6d611d22fbf363b39d..dd9a7c97c9ab5f5ca8a2431955e28e321607be8d 100644 (file)
@@ -8,21 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(globs)]
 #![allow(unused_imports, dead_code)]
 
-use foo::GC;
+use foo::Foo;
 
 mod foo {
-    pub use m::GC; // this should shadow d::GC
+    pub use m::Foo; // this should shadow d::Foo
 }
 
 mod m {
-    pub struct GC;
+    pub struct Foo;
 }
 
 mod d {
-    pub struct GC;
+    pub struct Foo;
 }
 
 fn main() {}
index 777210d2b04525cc8facab9c12f7a47fc317a387..84f046499e439ca1f96c64e15c626a0a401760a2 100644 (file)
 
 // aux-build:issue-2631-a.rs
 
-extern crate collections;
 extern crate req;
 
 use req::request;
 use std::cell::RefCell;
 use std::collections::HashMap;
-use std::gc::GC;
+use std::rc::Rc;
 
 pub fn main() {
-  let v = vec!(box(GC) "hi".to_string());
+  let v = vec!(Rc::new("hi".to_string()));
   let mut m: req::header_map = HashMap::new();
-  m.insert("METHOD".to_string(), box(GC) RefCell::new(v));
+  m.insert("METHOD".to_string(), Rc::new(RefCell::new(v)));
   request::<int>(&m);
 }
index e11cb28c65db8dbe93495a4ade6713b3af0427f2..3ac4b874f3ad8cb00dd48fb3e1622c0d13c10174 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 struct Font {
     fontbuf: uint,
     cairo_font: uint,
@@ -31,5 +29,5 @@ fn Font() -> Font {
 }
 
 pub fn main() {
-    let _f = box(GC) Font();
+    let _f = box Font();
 }
index f7a91d11748b3bbdc5990366f3900a061ebf9258..0d1cf1c339227689787ff76a3712ea3719973ff3 100644 (file)
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
 // This test should behave exactly like issue-2735-3
-struct defer {
-    b: Gc<Cell<bool>>,
+struct defer<'a> {
+    b: &'a Cell<bool>,
 }
 
 #[unsafe_destructor]
-impl Drop for defer {
+impl<'a> Drop for defer<'a> {
     fn drop(&mut self) {
         self.b.set(true);
     }
 }
 
-fn defer(b: Gc<Cell<bool>>) -> defer {
+fn defer(b: &Cell<bool>) -> defer {
     defer {
         b: b
     }
 }
 
 pub fn main() {
-    let dtor_ran = box(GC) Cell::new(false);
+    let dtor_ran = &Cell::new(false);
     let _  = defer(dtor_ran);
     assert!(dtor_ran.get());
 }
index 3650c3f9246432f04336d9473764844d5c709d98..658183cf6ff5437b64fc1c74f1d58b55aa033b02 100644 (file)
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
 // This test should behave exactly like issue-2735-2
-struct defer {
-    b: Gc<Cell<bool>>,
+struct defer<'a> {
+    b: &'a Cell<bool>,
 }
 
 #[unsafe_destructor]
-impl Drop for defer {
+impl<'a> Drop for defer<'a> {
     fn drop(&mut self) {
         self.b.set(true);
     }
 }
 
-fn defer(b: Gc<Cell<bool>>) -> defer {
+fn defer(b: &Cell<bool>) -> defer {
     defer {
         b: b
     }
 }
 
 pub fn main() {
-    let dtor_ran = box(GC) Cell::new(false);
+    let dtor_ran = &Cell::new(false);
     defer(dtor_ran);
     assert!(dtor_ran.get());
 }
index 96e60dab3c9c672d2ccf6aaf92f989f45d4c4b7d..aa2ce824822b1d580e19a0e5d67a67a067549d7d 100644 (file)
 extern crate socketlib;
 extern crate libc;
 
-use std::gc::GC;
 use socketlib::socket;
 
 pub fn main() {
     let fd: libc::c_int = 1 as libc::c_int;
-    let _sock = box(GC) socket::socket_handle(fd);
+    let _sock = box socket::socket_handle(fd);
 }
index 24ffd416499206b65cd9b311eeb822114387ec78..6b320e1474624a5e66b6dcde3ba202701cb01c7e 100644 (file)
@@ -9,13 +9,11 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
-
 enum side { mayo, catsup, vinegar }
 enum order { hamburger, fries(side), shake }
 enum meal { to_go(order), for_here(order) }
 
-fn foo(m: Gc<meal>, cond: bool) {
+fn foo(m: Box<meal>, cond: bool) {
     match *m {
       to_go(_) => { }
       for_here(_) if cond => {}
@@ -26,5 +24,5 @@ fn foo(m: Gc<meal>, cond: bool) {
 }
 
 pub fn main() {
-    foo(box(GC) for_here(hamburger), true)
+    foo(box for_here(hamburger), true)
 }
index 612e0a07dac129a810c707442b784c85ab960b17..4ebf981e4ee55aef4e4c1195c79b67b07204b5b9 100644 (file)
 
 
 use std::cell::RefCell;
-use std::gc::{Gc, GC};
 
 static S: &'static str = "str";
 
 struct list<T> {
     element: T,
-    next: Option<Gc<RefCell<list<T>>>>
+    next: Option<Box<RefCell<list<T>>>>
 }
 
 impl<T:'static> list<T> {
@@ -26,7 +25,7 @@ pub fn addEnd(&mut self, element: T) {
             next: None
         };
 
-        self.next = Some(box(GC) RefCell::new(newList));
+        self.next = Some(box RefCell::new(newList));
     }
 }
 
index b8a34b751814bd27aefd2c2a8cf7a1eadea52816..e59cf9f77fa6e9fc82f0555b2e6989fc5dbd2534 100644 (file)
@@ -9,18 +9,15 @@
 // except according to those terms.
 
 
-extern crate debug;
-
-use std::gc::{Gc, GC};
-
+#[deriving(Show)]
 enum Token {
-    Text(Gc<String>),
-    ETag(Gc<Vec<String>> , Gc<String>),
-    UTag(Gc<Vec<String>> , Gc<String>),
-    Section(Gc<Vec<String>> , bool, Gc<Vec<Token>>, Gc<String>,
-            Gc<String>, Gc<String>, Gc<String>, Gc<String>),
-    IncompleteSection(Gc<Vec<String>> , bool, Gc<String>, bool),
-    Partial(Gc<String>, Gc<String>, Gc<String>),
+    Text(String),
+    ETag(Vec<String>, String),
+    UTag(Vec<String>, String),
+    Section(Vec<String>, bool, Vec<Token>, String,
+            String, String, String, String),
+    IncompleteSection(Vec<String>, bool, String, bool),
+    Partial(String, String, String),
 }
 
 fn check_strs(actual: &str, expected: &str) -> bool
@@ -39,13 +36,13 @@ pub fn main()
 // assert!(check_strs(fmt!("%?", ETag(@~["foo".to_string()], @"bar".to_string())),
 //                    "ETag(@~[ ~\"foo\" ], @~\"bar\")"));
 
-    let t = Text(box(GC) "foo".to_string());
-    let u = Section(box(GC) vec!("alpha".to_string()),
-                          true,
-                          box(GC) vec!(t),
-                          box(GC) "foo".to_string(),
-                    box(GC) "foo".to_string(), box(GC) "foo".to_string(), box(GC) "foo".to_string(),
-                    box(GC) "foo".to_string());
-    let v = format!("{:?}", u);    // this is the line that causes the seg fault
+    let t = Text("foo".to_string());
+    let u = Section(vec!["alpha".to_string()],
+                    true,
+                    vec![t],
+                    "foo".to_string(),
+                    "foo".to_string(), "foo".to_string(), "foo".to_string(),
+                    "foo".to_string());
+    let v = format!("{}", u);    // this is the line that causes the seg fault
     assert!(v.len() > 0);
 }
index 93f8ebf02acdb5db6800937b57b9cf0b2c93e660..4010c31eed50a3575394763b677d26458d6038fd 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 pub struct Foo {
     a: int,
 }
@@ -20,7 +18,7 @@ struct Bar<'a> {
     b: &'a Foo,
 }
 
-fn check(a: Gc<Foo>) {
+fn check(a: Box<Foo>) {
     let _ic = Bar{ b: &*a, a: box None };
 }
 
index e124b2efe29f891ece25ba1b592a4de91a03bfbc..7eaaa5ea74eda657b05d3253ca4c7aa35aa5e3aa 100644 (file)
@@ -9,12 +9,10 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 enum Either<T, U> { Left(T), Right(U) }
 
 pub fn main() {
-    match Left(box(GC) 17i) {
+    match Left(box 17i) {
         Right(()) => {}
         _ => {}
     }
index f2dcaa4a31eaa2bdd29be934c815089ec780a394..3fff58410a41a86e8f9d307a2f6444d5b3a2b25c 100644 (file)
@@ -12,8 +12,6 @@
 
 extern crate debug;
 
-use std::gc::GC;
-
 fn assert_repr_eq<T>(obj : T, expected : String) {
     assert_eq!(expected, format!("{:?}", obj));
 }
@@ -23,12 +21,10 @@ pub fn main() {
     let tf = [true, false];
     let x  = [(), ()];
     let slice = x[0..1];
-    let z = box(GC) x;
 
     assert_repr_eq(abc, "[1, 2, 3]".to_string());
     assert_repr_eq(tf, "[true, false]".to_string());
     assert_repr_eq(x, "[(), ()]".to_string());
     assert_repr_eq(slice, "&[()]".to_string());
     assert_repr_eq(&x, "&[(), ()]".to_string());
-    assert_repr_eq(z, "box(GC) [(), ()]".to_string());
 }
diff --git a/src/test/run-pass/issue-8983.rs b/src/test/run-pass/issue-8983.rs
deleted file mode 100644 (file)
index 1291f0b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::GC;
-
-fn main() {
-    fn f(_: proc()) {}
-    fn eat<T>(_: T) {}
-
-    let x = box(GC) 1i;
-    f(proc() { eat(x) });
-}
index abe6a2d9ee63f58693dc331981da74cbf75aac3f..919f0aae38e0acb48a104fe9520d154ff0a75470 100644 (file)
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
-use std::gc::{GC, Gc};
 
-struct r {
-    b: Gc<Cell<int>>,
+struct r<'a> {
+    b: &'a Cell<int>,
 }
 
 #[unsafe_destructor]
-impl Drop for r {
+impl<'a> Drop for r<'a> {
     fn drop(&mut self) {
         self.b.set(self.b.get() + 1);
     }
 }
 
-fn r(b: Gc<Cell<int>>) -> r {
+fn r(b: &Cell<int>) -> r {
     r {
         b: b
     }
 }
 
 pub fn main() {
-    let b = box(GC) Cell::new(0);
+    let b = &Cell::new(0);
     {
         let _p = Some(r(b));
     }
diff --git a/src/test/run-pass/issue-980.rs b/src/test/run-pass/issue-980.rs
deleted file mode 100644 (file)
index 1083f1b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::cell::RefCell;
-use std::gc::{Gc, GC};
-
-enum maybe_pointy {
-    no_pointy,
-    yes_pointy(Gc<RefCell<Pointy>>),
-}
-
-struct Pointy {
-    x: maybe_pointy
-}
-
-pub fn main() {
-    let m = box(GC) RefCell::new(Pointy { x : no_pointy });
-    *m.borrow_mut() = Pointy {
-        x: yes_pointy(m)
-    };
-}
diff --git a/src/test/run-pass/leak-box-as-tydesc.rs b/src/test/run-pass/leak-box-as-tydesc.rs
deleted file mode 100644 (file)
index 57b9b24..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-fn leaky<T>(_t: T) { }
-
-pub fn main() { let x = box(GC) 10; leaky::<Gc<int>>(x); }
diff --git a/src/test/run-pass/leak-tag-copy.rs b/src/test/run-pass/leak-tag-copy.rs
deleted file mode 100644 (file)
index 3be122b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(dead_assignment)]
-#![allow(unused_variable)]
-
-use std::gc::{Gc, GC};
-
-enum t { a, b(Gc<int>), }
-
-pub fn main() { let mut x = b(box(GC) 10); x = a; }
index bbb3ce2f2e1a12dbf2ce7e4a833a6fbb29a36dd0..7d0778b685937f0cec8ba27a2bfe9b330de62b40 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
+enum list { cons(int, Box<list>), nil, }
 
-enum list { cons(int, Gc<list>), nil, }
-
-pub fn main() { cons(10, box(GC) cons(11, box(GC) cons(12, box(GC) nil))); }
+pub fn main() { cons(10, box cons(11, box cons(12, box nil))); }
diff --git a/src/test/run-pass/mlist.rs b/src/test/run-pass/mlist.rs
deleted file mode 100644 (file)
index ee91ae1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-enum mlist { cons(int, Gc<mlist>), nil, }
-
-pub fn main() { cons(10, box(GC) cons(11, box(GC) cons(12, box(GC) nil))); }
diff --git a/src/test/run-pass/move-1.rs b/src/test/run-pass/move-1.rs
deleted file mode 100644 (file)
index 6f4ffa5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-struct Triple { x: int, y: int, z: int }
-
-fn test(x: bool, foo: Gc<Triple>) -> int {
-    let bar = foo;
-    let mut y: Gc<Triple>;
-    y = bar;
-    if x { y = bar; } else { y = box(GC) Triple{x: 4, y: 5, z: 6}; }
-    return y.y;
-}
-
-pub fn main() {
-    let x = box(GC) Triple {x: 1, y: 2, z: 3};
-    assert_eq!(test(true, x), 2);
-    assert_eq!(test(true, x), 2);
-    assert_eq!(test(true, x), 2);
-    assert_eq!(test(false, x), 5);
-}
index bcc67738dd4e229359c60cd4b77ebab4a788202f..04540c2f35b29ef05fe73b00c59d5b973a38f4c1 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 struct X { x: int, y: int, z: int }
 
-pub fn main() { let x = box(GC) X {x: 1, y: 2, z: 3}; let y = x; assert!((y.y == 2)); }
+pub fn main() { let x = box X {x: 1, y: 2, z: 3}; let y = x; assert!((y.y == 2)); }
diff --git a/src/test/run-pass/move-3.rs b/src/test/run-pass/move-3.rs
deleted file mode 100644 (file)
index 21a7d57..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-struct Triple { x: int, y: int, z: int }
-
-fn test(x: bool, foo: Gc<Triple>) -> int {
-    let bar = foo;
-    let mut y: Gc<Triple>;
-    if x { y = bar; } else { y = box(GC) Triple{x: 4, y: 5, z: 6}; }
-    return y.y;
-}
-
-pub fn main() {
-    let x = box(GC) Triple{x: 1, y: 2, z: 3};
-    for _i in range(0u, 10000u) {
-        assert_eq!(test(true, x), 2);
-    }
-    assert_eq!(test(false, x), 5);
-}
index 984cef559983da4a67056ce8ca84285203a6f71d..5e5d01ae6ee4529d209f1d1b4bb29e8aa470ce78 100644 (file)
@@ -9,11 +9,9 @@
 // except according to those terms.
 
 
-use std::gc::{GC, Gc};
-
 struct Triple { a: int, b: int, c: int }
 
-fn test(foo: Gc<Triple>) -> Gc<Triple> {
+fn test(foo: Box<Triple>) -> Box<Triple> {
     let foo = foo;
     let bar = foo;
     let baz = bar;
@@ -22,7 +20,7 @@ fn test(foo: Gc<Triple>) -> Gc<Triple> {
 }
 
 pub fn main() {
-    let x = box(GC) Triple{a: 1, b: 2, c: 3};
+    let x = box Triple{a: 1, b: 2, c: 3};
     let y = test(x);
     assert_eq!(y.c, 3);
 }
index d00cdcca3e362feb7f070de076414419d9ac81a8..840a3c2a6ee86caf63b393390eec597a0f360e47 100644 (file)
@@ -9,15 +9,13 @@
 // except according to those terms.
 
 
-use std::gc::{Gc, GC};
-
-fn test(foo: Gc<Vec<int>>) { assert!((*foo.get(0) == 10)); }
+fn test(foo: Box<Vec<int>>) { assert!((*foo.get(0) == 10)); }
 
 pub fn main() {
-    let x = box(GC) vec!(10);
+    let x = box vec!(10);
     // Test forgetting a local by move-in
     test(x);
 
     // Test forgetting a temporary by move-in.
-    test(box(GC) vec!(10));
+    test(box vec!(10));
 }
diff --git a/src/test/run-pass/mutable-vec-drop.rs b/src/test/run-pass/mutable-vec-drop.rs
deleted file mode 100644 (file)
index 665303a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(unused_mut)]
-
-use std::gc::{Gc, GC};
-
-struct Pair { a: int, b: int}
-
-pub fn main() {
-    // This just tests whether the vec leaks its members.
-    let mut _pvec: Vec<Gc<Pair>> =
-        vec!(box(GC) Pair{a: 1, b: 2},
-             box(GC) Pair{a: 3, b: 4},
-             box(GC) Pair{a: 5, b: 6});
-}
index 18f332dbb97722d09439c4cacd361f6432e004b6..8444a632fe889c699f0cf932b524f83a1a56be3a 100644 (file)
@@ -9,14 +9,12 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
-
 enum colour { red, green, blue, }
 
-enum tree { children(Gc<list>), leaf(colour), }
+enum tree { children(Box<list>), leaf(colour), }
 
-enum list { cons(Gc<tree>, Gc<list>), nil, }
+enum list { cons(Box<tree>, Box<list>), nil, }
 
-enum small_list { kons(int, Gc<small_list>), neel, }
+enum small_list { kons(int, Box<small_list>), neel, }
 
 pub fn main() { }
index f61a8837e2c7c7dfe31eeb9fb92b6791d465cd73..991d0ecdc87a642356d4d3a1ce0e47940b4819b1 100644 (file)
@@ -11,9 +11,8 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-// Tests that the new `box` syntax works with unique pointers and GC pointers.
+// Tests that the new `box` syntax works with unique pointers.
 
-use std::gc::{Gc, GC};
 use std::boxed::{Box, HEAP};
 
 struct Structure {
@@ -24,12 +23,6 @@ struct Structure {
 pub fn main() {
     let x: Box<int> = box(HEAP) 2i;
     let y: Box<int> = box 2i;
-    let z: Gc<int> = box(GC) 2i;
-    let a: Gc<Structure> = box(GC) Structure {
-        x: 10,
-        y: 20,
-    };
     let b: Box<int> = box()(1i + 2);
     let c = box()(3i + 4);
-    let d = box(GC)(5i + 6);
 }
index 50971806a87460def2a2631cfd67dce11a55bb1b..8c35abad7f1e61e273b53a0595acb7a92e6ee06f 100644 (file)
 // Make sure the destructor is run for newtype structs.
 
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
-struct Foo(Gc<Cell<int>>);
+struct Foo<'a>(&'a Cell<int>);
 
 #[unsafe_destructor]
-impl Drop for Foo {
+impl<'a> Drop for Foo<'a> {
     fn drop(&mut self) {
         let Foo(i) = *self;
         i.set(23);
@@ -26,7 +25,7 @@ fn drop(&mut self) {
 }
 
 pub fn main() {
-    let y = box(GC) Cell::new(32);
+    let y = &Cell::new(32);
     {
         let _x = Foo(y);
     }
index a7d52b87e551a11d03e4d38b959fae64fdf73a69..0c66b139e7c2ede137450ff632631007339c7e13 100644 (file)
@@ -11,7 +11,6 @@
 #![feature(macro_rules)]
 
 use std::{option, mem};
-use std::gc::{Gc, GC};
 
 // Iota-reduction is a rule in the Calculus of (Co-)Inductive Constructions,
 // which "says that a destructor applied to an object built from a constructor
@@ -76,7 +75,6 @@ macro_rules! check_type {
 pub fn main() {
     check_type!(&17: &int);
     check_type!(box 18: Box<int>);
-    check_type!(box(GC) 19: Gc<int>);
     check_type!("foo".to_string(): String);
     check_type!(vec!(20, 22): Vec<int> );
     let mint: uint = unsafe { mem::transmute(main) };
index 9dd65bdcb263ec7a1900daf0b0ab28cc2b296eac..5708310abadbfe88e0740d981feed67b5ff0edca 100644 (file)
@@ -11,7 +11,6 @@
 #![feature(macro_rules)]
 
 use std::mem;
-use std::gc::Gc;
 
 enum E<T> { Thing(int, T), Nothing((), ((), ()), [i8, ..0]) }
 struct S<T>(int, T);
@@ -40,6 +39,5 @@ macro_rules! check_type {
 pub fn main() {
     check_type!(&'static int);
     check_type!(Box<int>);
-    check_type!(Gc<int>);
     check_type!(extern fn());
 }
diff --git a/src/test/run-pass/objects-owned-object-borrowed-method-header.rs b/src/test/run-pass/objects-owned-object-borrowed-method-header.rs
deleted file mode 100644 (file)
index 60c46d1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{Gc, GC};
-
-// Test invoked `&self` methods on owned objects where the values
-// closed over contain managed values. This implies that the boxes
-// will have headers that must be skipped over.
-
-trait FooTrait {
-    fn foo(&self) -> uint;
-}
-
-struct BarStruct {
-    x: Gc<uint>
-}
-
-impl FooTrait for BarStruct {
-    fn foo(&self) -> uint {
-        *self.x
-    }
-}
-
-pub fn main() {
-    let foos: Vec<Box<FooTrait>> = vec!(
-        box BarStruct{ x: box(GC) 0 } as Box<FooTrait>,
-        box BarStruct{ x: box(GC) 1 } as Box<FooTrait>,
-        box BarStruct{ x: box(GC) 2 } as Box<FooTrait>
-    );
-
-    for i in range(0u, foos.len()) {
-        assert_eq!(i, foos.get(i).foo());
-    }
-}
index a6730d67ce0a45271dd5f3d74541dbe0176f3c08..8bdae89e523fd3e102c146a7cad8f712d5f488cf 100644 (file)
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
-use std::gc::{GC, Gc};
 
-struct dtor {
-    x: Gc<Cell<int>>,
+struct dtor<'a> {
+    x: &'a Cell<int>,
 }
 
 #[unsafe_destructor]
-impl Drop for dtor {
+impl<'a> Drop for dtor<'a> {
     fn drop(&mut self) {
-        // abuse access to shared mutable state to write this code
         self.x.set(self.x.get() - 1);
     }
 }
@@ -33,7 +31,7 @@ fn unwrap<T>(o: Option<T>) -> T {
 }
 
 pub fn main() {
-    let x = box(GC) Cell::new(1);
+    let x = &Cell::new(1);
 
     {
         let b = Some(dtor { x:x });
index 34dccb8186586039b8e473f7bd2ea059aedf2bf0..8a10cc8c1ef4b4798d859e01c1e58f25cb279461 100644 (file)
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 
-use std::gc::{Gc, GC};
-
 struct A { a: int, b: int }
-struct Abox { a: Gc<int>, b: Gc<int> }
+struct Abox { a: Box<int>, b: Box<int> }
 
-fn ret_int_i() -> int { return 10; }
+fn ret_int_i() -> int { 10 }
 
-fn ret_ext_i() -> Gc<int> { return box(GC) 10; }
+fn ret_ext_i() -> Box<int> { box 10 }
 
-fn ret_int_rec() -> A { return A {a: 10, b: 10}; }
+fn ret_int_rec() -> A { A {a: 10, b: 10} }
 
-fn ret_ext_rec() -> Gc<A> { return box(GC) A {a: 10, b: 10}; }
+fn ret_ext_rec() -> Box<A> { box A {a: 10, b: 10} }
 
-fn ret_ext_mem() -> Abox { return Abox {a: box(GC) 10, b: box(GC) 10}; }
+fn ret_ext_mem() -> Abox { Abox {a: box 10, b: box 10} }
 
-fn ret_ext_ext_mem() -> Gc<Abox> { box(GC) Abox{a: box(GC) 10, b: box(GC) 10} }
+fn ret_ext_ext_mem() -> Box<Abox> { box Abox{a: box 10, b: box 10} }
 
 pub fn main() {
     let mut int_i: int;
-    let mut ext_i: Gc<int>;
+    let mut ext_i: Box<int>;
     let mut int_rec: A;
-    let mut ext_rec: Gc<A>;
+    let mut ext_rec: Box<A>;
     let mut ext_mem: Abox;
-    let mut ext_ext_mem: Gc<Abox>;
+    let mut ext_ext_mem: Box<Abox>;
     int_i = ret_int_i(); // initializing
 
     int_i = ret_int_i(); // non-initializing
index cfea444d7ffc7ee5100eb6afc29f5690d4748d0d..e6bfc8ec1a53de6be5f18f5fa4b7a8549b4e6622 100644 (file)
@@ -10,7 +10,6 @@
 
 
 use std::mem;
-use std::gc::Gc;
 
 #[repr(packed)]
 struct S4 {
@@ -48,7 +47,7 @@ struct S7_Option {
     a: f32,
     b: u8,
     c: u16,
-    d: Option<Gc<f64>>
+    d: Option<Box<f64>>
 }
 
 // Placing packed structs in statics should work
@@ -62,5 +61,5 @@ pub fn main() {
     assert_eq!(mem::size_of::<S5>(), 5);
     assert_eq!(mem::size_of::<S13>(), 13);
     assert_eq!(mem::size_of::<S3_Foo>(), 3 + mem::size_of::<Foo>());
-    assert_eq!(mem::size_of::<S7_Option>(), 7 + mem::size_of::<Option<Gc<f64>>>());
+    assert_eq!(mem::size_of::<S7_Option>(), 7 + mem::size_of::<Option<Box<f64>>>());
 }
index f23166288fb55a687df0efe576df890395fda693..8967b07ca8823757b788c07edf1e52c79a515f88 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::Gc;
 use std::mem;
 
 #[repr(packed)]
@@ -30,7 +29,7 @@ enum Foo {
 struct S3_Foo(u8, u16, Foo);
 
 #[repr(packed)]
-struct S7_Option(f32, u8, u16, Option<Gc<f64>>);
+struct S7_Option(f32, u8, u16, Option<Box<f64>>);
 
 pub fn main() {
     assert_eq!(mem::size_of::<S4>(), 4);
@@ -43,5 +42,5 @@ pub fn main() {
                3 + mem::size_of::<Foo>());
 
     assert_eq!(mem::size_of::<S7_Option>(),
-              7 + mem::size_of::<Option<Gc<f64>>>());
+              7 + mem::size_of::<Option<Box<f64>>>());
 }
diff --git a/src/test/run-pass/pass-by-copy.rs b/src/test/run-pass/pass-by-copy.rs
deleted file mode 100644 (file)
index 8820919..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-extern crate debug;
-
-use std::gc::{GC, Gc};
-
-fn magic(x: A) { println!("{:?}", x); }
-fn magic2(x: Gc<int>) { println!("{:?}", x); }
-
-struct A { a: Gc<int> }
-
-pub fn main() {
-    let a = A {a: box(GC) 10};
-    let b = box(GC) 10;
-    magic(a); magic(A {a: box(GC) 20});
-    magic2(b); magic2(box(GC) 20);
-}
index b856386e1d353ba0e99ad721272598bef0f56dbe..8ad2dbc1acb75965906deb0bbbfa23ce45fa3677 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 trait get {
     fn get(self) -> int;
 }
@@ -25,15 +23,6 @@ fn get(self) -> int {
 }
 
 pub fn main() {
-    let x = box(GC) 6;
-    let y = x.get();
-    assert_eq!(y, 6);
-
-    let x = box(GC) 6;
-    let y = x.get();
-    println!("y={}", y);
-    assert_eq!(y, 6);
-
     let x = box 6;
     let y = x.get();
     println!("y={}", y);
index 15206f1c386d3762f532ef18c4c523478b58fcee..9a758c5d8ada48e9f2adfbe2d9f6dfb3007c1e39 100644 (file)
@@ -9,14 +9,12 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 fn foo(x: &uint) -> uint {
     *x
 }
 
 pub fn main() {
-    let p = box(GC) 22u;
+    let p = box 22u;
     let r = foo(&*p);
     println!("r={}", r);
     assert_eq!(r, 22u);
index 09d9008c0b64a92235f8f2b3bf87be3b970032dd..5b0b7cc5b4ef1a3e9dc501b4aac8cfc3f6b76257 100644 (file)
@@ -9,12 +9,10 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 fn foo(x: &uint) -> &uint { x }
 fn bar(x: &uint) -> uint { *x }
 
 pub fn main() {
-    let p = box(GC) 3u;
+    let p = box 3u;
     assert_eq!(bar(foo(&*p)), 3);
 }
index 4d4417189c9081f805566c8235cf64e47bb07c13..1ecaf41702e0642a179c0dfc2885f92d2c22e3a9 100644 (file)
@@ -8,12 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::gc::GC;
-
 fn borrow<T>(x: &T) -> &T {x}
 
 pub fn main() {
-    let x = box(GC) 3i;
+    let x = box 3i;
     loop {
         let y = borrow(&*x);
         assert_eq!(*x, *y);
index 4c021b18ad858dc4866f270bf14fc94778f41e31..d3dbca53f605f229c409ea528f788c3d26bed4c4 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 struct Point {x: int, y: int}
 
 fn x_coord(p: &Point) -> &int {
@@ -18,7 +16,7 @@ fn x_coord(p: &Point) -> &int {
 }
 
 pub fn main() {
-    let p = box(GC) Point {x: 3, y: 4};
+    let p = box Point {x: 3, y: 4};
     let xc = x_coord(&*p);
     assert_eq!(*xc, 3);
 }
index 48022fefbbdba343dae18e0f66d86bb7f8fe4478..5ea22ae76c2c06b904dd0f395d7ef7e0682456e6 100644 (file)
 
 #![feature(unsafe_destructor)]
 
-extern crate debug;
-
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
-struct r {
-    i: Gc<Cell<int>>,
+#[deriving(Show)]
+struct r<'a> {
+    i: &'a Cell<int>,
 }
 
 #[unsafe_destructor]
-impl Drop for r {
+impl<'a> Drop for r<'a> {
     fn drop(&mut self) {
         self.i.set(self.i.get() + 1);
     }
 }
 
-fn r(i: Gc<Cell<int>>) -> r {
+fn r(i: &Cell<int>) -> r {
     r {
         i: i
     }
 }
 
 pub fn main() {
-    let i = box(GC) Cell::new(0i);
+    let i = &Cell::new(0i);
     // Even though these look like copies, they are guaranteed not to be
     {
         let a = r(i);
         let b = (a, 10i);
         let (c, _d) = b;
-        println!("{:?}", c);
+        println!("{}", c);
     }
     assert_eq!(i.get(), 1);
 }
index ba6a285d652f934d26ef257cdc0abd07c6a2269b..71bf6cc626153d38e962626512f59fd66a4c9c96 100644 (file)
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
-use std::gc::{GC, Gc};
 
-struct shrinky_pointer {
-  i: Gc<Gc<Cell<int>>>,
+struct shrinky_pointer<'a> {
+  i: &'a Cell<int>,
 }
 
 #[unsafe_destructor]
-impl Drop for shrinky_pointer {
+impl<'a> Drop for shrinky_pointer<'a> {
     fn drop(&mut self) {
         println!("Hello!"); self.i.set(self.i.get() - 1);
     }
 }
 
-impl shrinky_pointer {
+impl<'a> shrinky_pointer<'a> {
     pub fn look_at(&self) -> int { return self.i.get(); }
 }
 
-fn shrinky_pointer(i: Gc<Gc<Cell<int>>>) -> shrinky_pointer {
+fn shrinky_pointer(i: &Cell<int>) -> shrinky_pointer {
     shrinky_pointer {
         i: i
     }
 }
 
 pub fn main() {
-    let my_total = box(GC) box(GC) Cell::new(10);
+    let my_total = &Cell::new(10);
     { let pt = shrinky_pointer(my_total); assert!((pt.look_at() == 10)); }
     println!("my_total = {}", my_total.get());
     assert_eq!(my_total.get(), 9);
index fd1efe1a20eeeab3e27d673bda5363c67d0d5842..8e798fc6a0d28738f2c0289786efaa780e59a0a5 100644 (file)
 // variant
 
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
-type closable = Gc<Cell<bool>>;
+type closable<'a> = &'a Cell<bool>;
 
-struct close_res {
-  i: closable,
+struct close_res<'a> {
+  i: closable<'a>,
 
 }
 
 #[unsafe_destructor]
-impl Drop for close_res {
+impl<'a> Drop for close_res<'a> {
     fn drop(&mut self) {
         self.i.set(false);
     }
@@ -41,7 +40,7 @@ enum option<T> { none, some(T), }
 fn sink(_res: option<close_res>) { }
 
 pub fn main() {
-    let c = box(GC) Cell::new(true);
+    let c = &Cell::new(true);
     sink(none);
     sink(some(close_res(c)));
     assert!(!c.get());
index b58db67c0acf1fbda587002d4e20d30715af55e1..2d6da26df52a32220c2f0be94bf2b15700cebaf0 100644 (file)
@@ -9,30 +9,26 @@
 // except according to those terms.
 
 
-extern crate debug;
-
 // Exercises a bug in the shape code that was exposed
 // on x86_64: when there is an enum embedded in an
 // interior record which is then itself interior to
 // something else, shape calculations were off.
 
-use std::gc::{Gc, GC};
-
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 enum opt_span {
     //hack (as opposed to option), to make `span` compile
     os_none,
-    os_some(Gc<Span>),
+    os_some(Box<Span>),
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 struct Span {
     lo: uint,
     hi: uint,
     expanded_from: opt_span,
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 struct Spanned<T> {
     data: T,
     span: Span,
@@ -40,17 +36,17 @@ struct Spanned<T> {
 
 type ty_ = uint;
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 struct Path_ {
     global: bool,
     idents: Vec<String> ,
-    types: Vec<Gc<ty>>,
+    types: Vec<Box<ty>>,
 }
 
 type path = Spanned<Path_>;
 type ty = Spanned<ty_>;
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 struct X {
     sp: Span,
     path: path,
@@ -58,14 +54,14 @@ struct X {
 
 pub fn main() {
     let sp: Span = Span {lo: 57451u, hi: 57542u, expanded_from: os_none};
-    let t: Gc<ty> = box(GC) Spanned { data: 3u, span: sp };
+    let t: Box<ty> = box Spanned { data: 3u, span: sp.clone() };
     let p_: Path_ = Path_ {
         global: true,
         idents: vec!("hi".to_string()),
         types: vec!(t),
     };
-    let p: path = Spanned { data: p_, span: sp };
+    let p: path = Spanned { data: p_, span: sp.clone() };
     let x = X { sp: sp, path: p };
-    println!("{:?}", x.path.clone());
-    println!("{:?}", x.clone());
+    println!("{}", x.path.clone());
+    println!("{}", x.clone());
 }
index fcce05a7b09cb835448f39632c7b2646449d2f7f..41a9e6e53f251772d893ab56406fd7c56c000730 100644 (file)
 // Don't try to clean up uninitialized locals
 
 use std::task;
-use std::gc::{Gc};
 
-fn test_break() { loop { let _x: Gc<int> = break; } }
+fn test_break() { loop { let _x: Box<int> = break; } }
 
-fn test_cont() { let mut i = 0i; while i < 1 { i += 1; let _x: Gc<int> = continue; } }
+fn test_cont() { let mut i = 0i; while i < 1 { i += 1; let _x: Box<int> = continue; } }
 
-fn test_ret() { let _x: Gc<int> = return; }
+fn test_ret() { let _x: Box<int> = return; }
 
 fn test_fail() {
-    fn f() { let _x: Gc<int> = fail!(); }
+    fn f() { let _x: Box<int> = fail!(); }
     task::try(proc() f() );
 }
 
 fn test_fail_indirect() {
     fn f() -> ! { fail!(); }
-    fn g() { let _x: Gc<int> = f(); }
+    fn g() { let _x: Box<int> = f(); }
     task::try(proc() g() );
 }
 
diff --git a/src/test/run-pass/trait-cast.rs b/src/test/run-pass/trait-cast.rs
deleted file mode 100644 (file)
index 30acf07..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-pretty FIXME(#14193)
-
-
-// Test cyclic detector when using trait instances.
-
-use std::cell::RefCell;
-use std::gc::{GC, Gc};
-
-struct Tree(Gc<RefCell<TreeR>>);
-struct TreeR {
-    left: Option<Tree>,
-    right: Option<Tree>,
-    val: Box<to_str+Send>
-}
-
-trait to_str {
-    fn to_str_(&self) -> String;
-}
-
-impl<T:to_str> to_str for Option<T> {
-    fn to_str_(&self) -> String {
-        match *self {
-          None => { "none".to_string() }
-          Some(ref t) => format!("some({})", t.to_str_()),
-        }
-    }
-}
-
-impl to_str for int {
-    fn to_str_(&self) -> String {
-        self.to_string()
-    }
-}
-
-impl to_str for Tree {
-    fn to_str_(&self) -> String {
-        let Tree(t) = *self;
-        let this = t.borrow();
-        let (l, r) = (this.left, this.right);
-        let val = &this.val;
-        format!("[{}, {}, {}]", val.to_str_(), l.to_str_(), r.to_str_())
-    }
-}
-
-fn foo<T:to_str>(x: T) -> String { x.to_str_() }
-
-pub fn main() {
-    let t1 = Tree(box(GC) RefCell::new(TreeR{left: None,
-                                       right: None,
-                                       val: box 1i as Box<to_str+Send>}));
-    let t2 = Tree(box(GC) RefCell::new(TreeR{left: Some(t1),
-                                       right: Some(t1),
-                                       val: box 2i as Box<to_str+Send>}));
-    let expected =
-        "[2, some([1, none, none]), some([1, none, none])]".to_string();
-    assert!(t2.to_str_() == expected);
-    assert!(foo(t2) == expected);
-
-    {
-        let Tree(t1_) = t1;
-        let mut t1 = t1_.borrow_mut();
-        t1.left = Some(t2); // create cycle
-    }
-}
index 41a8ca33a2ab99e3e509bf7ee5df75715fcf3388..7265ddf661501934187c9d9749d2278fc7a16c37 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 fn p_foo<T>(_pinned: T) { }
 fn s_foo<T>(_shared: T) { }
 fn u_foo<T:Send>(_unique: T) { }
@@ -31,15 +29,11 @@ fn r(i:int) -> r {
 
 pub fn main() {
     p_foo(r(10));
-    p_foo(box(GC) r(10));
 
     p_foo(box r(10));
-    p_foo(box(GC) 10i);
     p_foo(box 10i);
     p_foo(10i);
 
-    s_foo(box(GC) r(10));
-    s_foo(box(GC) 10i);
     s_foo(box 10i);
     s_foo(10i);
 
index 0cd6210e13c795e65e7cf78ca0c8cb7e046b7b4c..6d8e7d1aaf3fdb66fde42ce974851073f0f0484d 100644 (file)
 // Example from lkuper's intern talk, August 2012 -- now with static
 // methods!
 
-use std::gc::{GC, Gc};
-
 trait Equal {
-    fn isEq(a: Self, b: Self) -> bool;
+    fn isEq(a: &Self, b: &Self) -> bool;
 }
 
 enum Color { cyan, magenta, yellow, black }
 
 impl Equal for Color {
-    fn isEq(a: Color, b: Color) -> bool {
-        match (a, b) {
+    fn isEq(a: &Color, b: &Color) -> bool {
+        match (*a, *b) {
           (cyan, cyan)       => { true  }
           (magenta, magenta) => { true  }
           (yellow, yellow)   => { true  }
@@ -34,15 +32,15 @@ fn isEq(a: Color, b: Color) -> bool {
 
 enum ColorTree {
     leaf(Color),
-    branch(Gc<ColorTree>, Gc<ColorTree>)
+    branch(Box<ColorTree>, Box<ColorTree>)
 }
 
 impl Equal for ColorTree {
-    fn isEq(a: ColorTree, b: ColorTree) -> bool {
+    fn isEq(a: &ColorTree, b: &ColorTree) -> bool {
         match (a, b) {
-          (leaf(x), leaf(y)) => { Equal::isEq(x, y) }
-          (branch(l1, r1), branch(l2, r2)) => {
-            Equal::isEq(*l1, *l2) && Equal::isEq(*r1, *r2)
+          (&leaf(x), &leaf(y)) => { Equal::isEq(&x, &y) }
+          (&branch(ref l1, ref r1), &branch(ref l2, ref r2)) => {
+            Equal::isEq(&**l1, &**l2) && Equal::isEq(&**r1, &**r2)
           }
           _ => { false }
         }
@@ -50,19 +48,19 @@ fn isEq(a: ColorTree, b: ColorTree) -> bool {
 }
 
 pub fn main() {
-    assert!(Equal::isEq(cyan, cyan));
-    assert!(Equal::isEq(magenta, magenta));
-    assert!(!Equal::isEq(cyan, yellow));
-    assert!(!Equal::isEq(magenta, cyan));
+    assert!(Equal::isEq(&cyan, &cyan));
+    assert!(Equal::isEq(&magenta, &magenta));
+    assert!(!Equal::isEq(&cyan, &yellow));
+    assert!(!Equal::isEq(&magenta, &cyan));
 
-    assert!(Equal::isEq(leaf(cyan), leaf(cyan)));
-    assert!(!Equal::isEq(leaf(cyan), leaf(yellow)));
+    assert!(Equal::isEq(&leaf(cyan), &leaf(cyan)));
+    assert!(!Equal::isEq(&leaf(cyan), &leaf(yellow)));
 
-    assert!(Equal::isEq(branch(box(GC) leaf(magenta), box(GC) leaf(cyan)),
-                branch(box(GC) leaf(magenta), box(GC) leaf(cyan))));
+    assert!(Equal::isEq(&branch(box leaf(magenta), box leaf(cyan)),
+                &branch(box leaf(magenta), box leaf(cyan))));
 
-    assert!(!Equal::isEq(branch(box(GC) leaf(magenta), box(GC) leaf(cyan)),
-                 branch(box(GC) leaf(magenta), box(GC) leaf(magenta))));
+    assert!(!Equal::isEq(&branch(box leaf(magenta), box leaf(cyan)),
+                 &branch(box leaf(magenta), box leaf(magenta))));
 
     println!("Assertions all succeeded!");
 }
index 0a77824cf47f7728981ee8cc04587587a1f889e9..cbb85b2b7b814500ca3cdfd4b09089f856c803ab 100644 (file)
 
 // Example from lkuper's intern talk, August 2012.
 
-use std::gc::{GC, Gc};
-
 trait Equal {
-    fn isEq(&self, a: Self) -> bool;
+    fn isEq(&self, a: &Self) -> bool;
 }
 
 enum Color { cyan, magenta, yellow, black }
 
 impl Equal for Color {
-    fn isEq(&self, a: Color) -> bool {
-        match (*self, a) {
+    fn isEq(&self, a: &Color) -> bool {
+        match (*self, *a) {
           (cyan, cyan)       => { true  }
           (magenta, magenta) => { true  }
           (yellow, yellow)   => { true  }
@@ -33,15 +31,15 @@ fn isEq(&self, a: Color) -> bool {
 
 enum ColorTree {
     leaf(Color),
-    branch(Gc<ColorTree>, Gc<ColorTree>)
+    branch(Box<ColorTree>, Box<ColorTree>)
 }
 
 impl Equal for ColorTree {
-    fn isEq(&self, a: ColorTree) -> bool {
-        match (*self, a) {
-          (leaf(x), leaf(y)) => { x.isEq(y) }
-          (branch(l1, r1), branch(l2, r2)) => {
-            (*l1).isEq(*l2) && (*r1).isEq(*r2)
+    fn isEq(&self, a: &ColorTree) -> bool {
+        match (self, a) {
+          (&leaf(x), &leaf(y)) => { x.isEq(&y) }
+          (&branch(ref l1, ref r1), &branch(ref l2, ref r2)) => {
+            (&**l1).isEq(&**l2) && (&**r1).isEq(&**r2)
           }
           _ => { false }
         }
@@ -49,19 +47,19 @@ fn isEq(&self, a: ColorTree) -> bool {
 }
 
 pub fn main() {
-    assert!(cyan.isEq(cyan));
-    assert!(magenta.isEq(magenta));
-    assert!(!cyan.isEq(yellow));
-    assert!(!magenta.isEq(cyan));
+    assert!(cyan.isEq(&cyan));
+    assert!(magenta.isEq(&magenta));
+    assert!(!cyan.isEq(&yellow));
+    assert!(!magenta.isEq(&cyan));
 
-    assert!(leaf(cyan).isEq(leaf(cyan)));
-    assert!(!leaf(cyan).isEq(leaf(yellow)));
+    assert!(leaf(cyan).isEq(&leaf(cyan)));
+    assert!(!leaf(cyan).isEq(&leaf(yellow)));
 
-    assert!(branch(box(GC) leaf(magenta), box(GC) leaf(cyan))
-        .isEq(branch(box(GC) leaf(magenta), box(GC) leaf(cyan))));
+    assert!(branch(box leaf(magenta), box leaf(cyan))
+        .isEq(&branch(box leaf(magenta), box leaf(cyan))));
 
-    assert!(!branch(box(GC) leaf(magenta), box(GC) leaf(cyan))
-        .isEq(branch(box(GC) leaf(magenta), box(GC) leaf(magenta))));
+    assert!(!branch(box leaf(magenta), box leaf(cyan))
+        .isEq(&branch(box leaf(magenta), box leaf(magenta))));
 
     println!("Assertions all succeeded!");
 }
diff --git a/src/test/run-pass/uniq-cc-generic.rs b/src/test/run-pass/uniq-cc-generic.rs
deleted file mode 100644 (file)
index e342dcb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-pretty FIXME(#14193)
-
-
-use std::cell::RefCell;
-use std::gc::{Gc, GC};
-
-enum maybe_pointy {
-    none,
-    p(Gc<RefCell<Pointy>>),
-}
-
-struct Pointy {
-    a : maybe_pointy,
-    d : proc():Send -> uint,
-}
-
-fn make_uniq_closure<A:Send>(a: A) -> proc():Send -> uint {
-    proc() { &a as *const A as uint }
-}
-
-fn empty_pointy() -> Gc<RefCell<Pointy>> {
-    return box(GC) RefCell::new(Pointy {
-        a : none,
-        d : make_uniq_closure("hi".to_string())
-    })
-}
-
-pub fn main() {
-    let v = empty_pointy();
-    {
-        let mut vb = v.borrow_mut();
-        vb.a = p(v);
-    }
-}
diff --git a/src/test/run-pass/uniq-cc.rs b/src/test/run-pass/uniq-cc.rs
deleted file mode 100644 (file)
index c7aca64..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::cell::RefCell;
-use std::gc::{Gc, GC};
-
-enum maybe_pointy {
-    none,
-    p(Gc<RefCell<Pointy>>),
-}
-
-struct Pointy {
-    a : maybe_pointy,
-    c : Box<int>,
-    d : proc():Send->(),
-}
-
-fn empty_pointy() -> Gc<RefCell<Pointy>> {
-    return box(GC) RefCell::new(Pointy {
-        a : none,
-        c : box 22,
-        d : proc() {},
-    })
-}
-
-pub fn main() {
-    let v = empty_pointy();
-    {
-        let mut vb = v.borrow_mut();
-        vb.a = p(v);
-    }
-}
index 478565c86fd4871ff8cf4efa0eec862917a1074c..493ec8ddc207d5b7a8763fc6a46fb4f64ad09fb4 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 
-use std::gc::GC;
-
 fn f<T>(t: T) -> T {
     let t1 = t;
     t1
@@ -19,6 +17,4 @@ fn f<T>(t: T) -> T {
 pub fn main() {
     let t = f(box 100i);
     assert_eq!(t, box 100i);
-    let t = f(box box(GC) vec!(100i));
-    assert_eq!(t, box box(GC) vec!(100i));
 }
diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs
deleted file mode 100644 (file)
index 70c8c5b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::task;
-use std::gc::GC;
-
-fn f() {
-    let _a = box(GC) 0i;
-    fail!();
-}
-
-pub fn main() {
-    task::spawn(f);
-}
diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs
deleted file mode 100644 (file)
index 6d04c0e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(unsafe_destructor)]
-
-use std::task;
-use std::gc::{Gc, GC};
-
-struct complainer {
-  c: Gc<int>,
-}
-
-#[unsafe_destructor]
-impl Drop for complainer {
-    fn drop(&mut self) {}
-}
-
-fn complainer(c: Gc<int>) -> complainer {
-    complainer {
-        c: c
-    }
-}
-
-fn f() {
-    let _c = complainer(box(GC) 0);
-    fail!();
-}
-
-pub fn main() {
-    task::spawn(f);
-}
diff --git a/src/test/run-pass/vec-drop.rs b/src/test/run-pass/vec-drop.rs
deleted file mode 100644 (file)
index 6cc95a2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-use std::gc::{GC, Gc};
-
-struct Pair { x: int, y: int }
-
-pub fn main() {
-    // This just tests whether the vec leaks its members.
-
-    let _pvec: Vec<Gc<Pair>> =
-        vec!(box(GC) Pair{x: 1, y: 2},
-             box(GC) Pair{x: 3, y: 4},
-             box(GC) Pair{x: 5, y: 6});
-}
index 42132f0a12f4b6e0a92e5c230edafd960ac58bd0..498ec0e8fbaf1ae8974bea837a057c763bd8ae43 100644 (file)
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
-use std::gc::{Gc, GC};
 
 // Make sure that destructors get run on slice literals
-struct foo {
-    x: Gc<Cell<int>>,
+struct foo<'a> {
+    x: &'a Cell<int>,
 }
 
 #[unsafe_destructor]
-impl Drop for foo {
+impl<'a> Drop for foo<'a> {
     fn drop(&mut self) {
         self.x.set(self.x.get() + 1);
     }
 }
 
-fn foo(x: Gc<Cell<int>>) -> foo {
+fn foo(x: &Cell<int>) -> foo {
     foo {
         x: x
     }
 }
 
 pub fn main() {
-    let x = box(GC) Cell::new(0);
+    let x = &Cell::new(0);
     {
         let l = &[foo(x)];
         assert_eq!(l[0].x.get(), 0);
index e8489e7c386cbef00d7bc2cc07886ec17dac1286..72204c28f82ade773eb42141ea6cc504ec2f3df1 100644 (file)
@@ -11,7 +11,6 @@
 
 use std::cell::Cell;
 use std::mem::swap;
-use std::gc::{Gc, GC};
 
 // Just a grab bag of stuff that you wouldn't want to actually write.
 
@@ -23,10 +22,10 @@ fn f(_x: ()) { }
 }
 
 fn what() {
-    fn the(x: Gc<Cell<bool>>) {
+    fn the(x: &Cell<bool>) {
         return while !x.get() { x.set(true); };
     }
-    let i = box(GC) Cell::new(false);
+    let i = &Cell::new(false);
     let dont = {||the(i)};
     dont();
     assert!((i.get()));