about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-06-22 13:11:29 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-06-22 13:11:29 -0700
commit588c1eb41ff88efe3cc971f341d6f866f66dd62c (patch)
treeb6c19e2425bbdb74f0501754b5e9319fcc57a296 /src
parent21399dca12a7bd812b89d359e2d838965c25f17d (diff)
Remove resources from remaining test cases
Diffstat (limited to 'src')
-rw-r--r--src/test/auxiliary/issue-2526.rs6
-rw-r--r--src/test/auxiliary/issue2170lib.rs6
-rw-r--r--src/test/auxiliary/test_comm.rs3
-rw-r--r--src/test/bench/task-perf-alloc-unwind.rs5
-rw-r--r--src/test/compile-fail/no-send-res-ports.rs8
-rw-r--r--src/test/compile-fail/regions-in-rsrcs.rs30
6 files changed, 44 insertions, 14 deletions
diff --git a/src/test/auxiliary/issue-2526.rs b/src/test/auxiliary/issue-2526.rs
index 9dd7d262731..700c5468e61 100644
--- a/src/test/auxiliary/issue-2526.rs
+++ b/src/test/auxiliary/issue-2526.rs
@@ -7,7 +7,11 @@ use std;
 
 export context;
 
-resource arc_destruct<T: const>(_data: int) { }
+class arc_destruct<T:const> {
+  let _data: int;
+  new(data: int) { self._data = data; }
+  drop {}
+}
 
 fn arc<T: const>(_data: T) -> arc_destruct<T> {
     arc_destruct(0)
diff --git a/src/test/auxiliary/issue2170lib.rs b/src/test/auxiliary/issue2170lib.rs
index 50f424594c9..915adafab66 100644
--- a/src/test/auxiliary/issue2170lib.rs
+++ b/src/test/auxiliary/issue2170lib.rs
@@ -3,6 +3,8 @@ export rsrc;
 fn foo(_x: i32) {
 }
 
-resource rsrc(x: i32) {
-    foo(x);
+class rsrc {
+  let x: i32;
+  new(x: i32) { self.x = x; }
+  drop { foo(self.x); }
 }
\ No newline at end of file
diff --git a/src/test/auxiliary/test_comm.rs b/src/test/auxiliary/test_comm.rs
index 48083fdf3f4..789836c9d63 100644
--- a/src/test/auxiliary/test_comm.rs
+++ b/src/test/auxiliary/test_comm.rs
@@ -1,6 +1,5 @@
 /*
-  Minimized version of core::comm (with still-local modifications
-  to turn a resource into a class) for testing. 
+  Minimized version of core::comm for testing. 
 
   Could probably be more minimal.
  */
diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs
index 7d4fd23342b..681abed4780 100644
--- a/src/test/bench/task-perf-alloc-unwind.rs
+++ b/src/test/bench/task-perf-alloc-unwind.rs
@@ -41,7 +41,10 @@ enum st {
     })
 }
 
-resource r(_l: @nillist) {
+class r {
+  let _l: @nillist;
+  new(l: @nillist) { self._l = l; }
+  drop {}
 }
 
 fn recurse_or_fail(depth: int, st: option<st>) {
diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs
index 1bbb362db57..3f8fde8927e 100644
--- a/src/test/compile-fail/no-send-res-ports.rs
+++ b/src/test/compile-fail/no-send-res-ports.rs
@@ -1,6 +1,10 @@
 fn main() {
-    resource foo(_x: comm::port<()>) {}
-
+    class foo {
+      let _x: comm::port<()>;
+      new(x: comm::port<()>) { self._x = x; }
+      drop {}
+    }
+   
     let x = ~mut some(foo(comm::port()));
 
     task::spawn {|move x| //! ERROR not a sendable value
diff --git a/src/test/compile-fail/regions-in-rsrcs.rs b/src/test/compile-fail/regions-in-rsrcs.rs
index 1c8e6c003ed..b190491e6d6 100644
--- a/src/test/compile-fail/regions-in-rsrcs.rs
+++ b/src/test/compile-fail/regions-in-rsrcs.rs
@@ -1,19 +1,37 @@
-resource no0(x: &uint) { //! ERROR to use region types here, the containing type must be declared with a region bound
+class no0 {
+  let x: &uint;
+  new(x: &uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound
+  drop {}
 }
 
-resource no1(x: &self.uint) { //! ERROR to use region types here, the containing type must be declared with a region bound
+class no1 {
+  let x: &self.uint;
+  new(x: &self.uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound
+  drop {}
 }
 
-resource no2(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
+class no2 {
+  let x: &foo.uint;
+  new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration
+  drop {}
 }
 
-resource yes0/&(x: &uint) {
+class yes0/& {
+  let x: &uint;
+  new(x: &uint) { self.x = x; }
+  drop {}
 }
 
-resource yes1/&(x: &self.uint) {
+class yes1/& {
+  let x: &self.uint;
+  new(x: &self.uint) { self.x = x; }
+  drop {}
 }
 
-resource yes2/&(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
+class yes2/& {
+  let x: &foo.uint;
+  new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration
+  drop {}
 }
 
 fn main() {}
\ No newline at end of file