Skip to content

Commit 588c1eb

Browse files
committed
Remove resources from remaining test cases
1 parent 21399dc commit 588c1eb

File tree

6 files changed

+44
-14
lines changed

6 files changed

+44
-14
lines changed

src/test/auxiliary/issue-2526.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ use std;
77

88
export context;
99

10-
resource arc_destruct<T: const>(_data: int) { }
10+
class arc_destruct<T:const> {
11+
let _data: int;
12+
new(data: int) { self._data = data; }
13+
drop {}
14+
}
1115

1216
fn arc<T: const>(_data: T) -> arc_destruct<T> {
1317
arc_destruct(0)

src/test/auxiliary/issue2170lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export rsrc;
33
fn foo(_x: i32) {
44
}
55

6-
resource rsrc(x: i32) {
7-
foo(x);
6+
class rsrc {
7+
let x: i32;
8+
new(x: i32) { self.x = x; }
9+
drop { foo(self.x); }
810
}

src/test/auxiliary/test_comm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
2-
Minimized version of core::comm (with still-local modifications
3-
to turn a resource into a class) for testing.
2+
Minimized version of core::comm for testing.
43
54
Could probably be more minimal.
65
*/

src/test/bench/task-perf-alloc-unwind.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ enum st {
4141
})
4242
}
4343

44-
resource r(_l: @nillist) {
44+
class r {
45+
let _l: @nillist;
46+
new(l: @nillist) { self._l = l; }
47+
drop {}
4548
}
4649

4750
fn recurse_or_fail(depth: int, st: option<st>) {

src/test/compile-fail/no-send-res-ports.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
fn main() {
2-
resource foo(_x: comm::port<()>) {}
3-
2+
class foo {
3+
let _x: comm::port<()>;
4+
new(x: comm::port<()>) { self._x = x; }
5+
drop {}
6+
}
7+
48
let x = ~mut some(foo(comm::port()));
59

610
task::spawn {|move x| //! ERROR not a sendable value
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
resource no0(x: &uint) { //! ERROR to use region types here, the containing type must be declared with a region bound
1+
class no0 {
2+
let x: &uint;
3+
new(x: &uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound
4+
drop {}
25
}
36

4-
resource no1(x: &self.uint) { //! ERROR to use region types here, the containing type must be declared with a region bound
7+
class no1 {
8+
let x: &self.uint;
9+
new(x: &self.uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound
10+
drop {}
511
}
612

7-
resource no2(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
13+
class no2 {
14+
let x: &foo.uint;
15+
new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration
16+
drop {}
817
}
918

10-
resource yes0/&(x: &uint) {
19+
class yes0/& {
20+
let x: &uint;
21+
new(x: &uint) { self.x = x; }
22+
drop {}
1123
}
1224

13-
resource yes1/&(x: &self.uint) {
25+
class yes1/& {
26+
let x: &self.uint;
27+
new(x: &self.uint) { self.x = x; }
28+
drop {}
1429
}
1530

16-
resource yes2/&(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
31+
class yes2/& {
32+
let x: &foo.uint;
33+
new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration
34+
drop {}
1735
}
1836

1937
fn main() {}

0 commit comments

Comments
 (0)