Skip to content

Commit c41abe1

Browse files
committed
---
yaml --- r: 13197 b: refs/heads/master c: 6e2aa3b h: refs/heads/master i: 13195: c73dd10 v: v3
1 parent 22a7683 commit c41abe1

File tree

9 files changed

+39
-23
lines changed

9 files changed

+39
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 14e3fdea9c0a4e9669d4c918af84b6306aca0123
2+
refs/heads/master: 6e2aa3b9986e1534ccdd2e12303b89507c579b00
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// test that autoderef of a type like this does not
22
// cause compiler to loop. Note that no instances
33
// of such a type could ever be constructed.
4-
resource t(x: x) {} //! ERROR this type cannot be instantiated
5-
enum x = @t; //! ERROR this type cannot be instantiated
6-
7-
fn new_t(x: t) {
8-
x.to_str; //! ERROR attempted access of field to_str
4+
class t { //! ERROR this type cannot be instantiated
5+
let x: x;
6+
let to_str: ();
7+
new(x: x) { self.x = x; self.to_str = (); }
98
}
9+
enum x = @t; //! ERROR this type cannot be instantiated
1010
1111
fn main() {
1212
}

trunk/src/test/compile-fail/non-const.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
fn foo<T: const>(_x: T) { }
44

5-
resource r(_x: int) {}
6-
resource r2(_x: @mut int) {}
5+
class r {
6+
let x:int;
7+
new(x:int) { self.x = x; }
8+
drop {}
9+
}
10+
11+
class r2 {
12+
let x:@mut int;
13+
new(x:@mut int) { self.x = x; }
14+
drop {}
15+
}
716

817
fn main() {
918
foo({f: 3});

trunk/src/test/compile-fail/pinned-deep-copy.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// error-pattern: copying a noncopyable value
22

3-
resource r(i: @mut int) {
4-
*i = *i + 1;
3+
class r {
4+
let i: @mut int;
5+
new(i: @mut int) { self.i = i; }
6+
drop { *(self.i) = *(self.i) + 1; }
57
}
68

79
fn main() {

trunk/src/test/compile-fail/record-with-resource.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// error-pattern: copying a noncopyable value
22

3-
resource my_resource(x: int) {
4-
log(error, x);
3+
class my_resource {
4+
let x: int;
5+
new(x: int) { self.x = x; }
6+
drop { log(error, self.x); }
57
}
68

79
fn main() {

trunk/src/test/compile-fail/regions-bounds.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
enum an_enum/& { }
66
iface an_iface/& { }
77
class a_class/& { new() { } }
8-
resource a_rsrc/&(_x: ()) { }
98

109
fn a_fn1(e: an_enum/&a) -> an_enum/&b {
1110
ret e; //! ERROR mismatched types: expected `an_enum/&b` but found `an_enum/&a`
@@ -19,11 +18,7 @@ fn a_fn3(e: a_class/&a) -> a_class/&b {
1918
ret e; //! ERROR mismatched types: expected `a_class/&b` but found `a_class/&a`
2019
}
2120

22-
fn a_fn4(e: a_rsrc/&a) -> a_rsrc/&b {
23-
ret e; //! ERROR mismatched types: expected `a_rsrc/&b` but found `a_rsrc/&a`
24-
}
25-
26-
fn a_fn5(e: int/&a) -> int/&b {
21+
fn a_fn4(e: int/&a) -> int/&b {
2722
//!^ ERROR Region parameters are not allowed on this type.
2823
//!^^ ERROR Region parameters are not allowed on this type.
2924
ret e;

trunk/src/test/compile-fail/unique-pinned-nocopy.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// error-pattern: copying a noncopyable value
22

3-
resource r(b: bool) {
3+
class r {
4+
let b:bool;
5+
new(b: bool) { self.b = b; }
6+
drop {}
47
}
58

69
fn main() {

trunk/src/test/compile-fail/unique-vec-res.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// error-pattern: copying a noncopyable value
22

3-
resource r(i: @mut int) {
4-
*i = *i + 1;
3+
class r {
4+
let i: @mut int;
5+
new(i: @mut int) { self.i = i; }
6+
drop { *(self.i) = *(self.i) + 1; }
57
}
68

79
fn f<T>(+i: [T], +j: [T]) {

trunk/src/test/compile-fail/vec-res-add.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// error-pattern: copying a noncopyable value
22

3-
resource r(_i: int) { }
3+
class r {
4+
new(_i:int) {}
5+
drop {}
6+
}
47

58
fn main() {
6-
// This can't make sense as it would copy the resources
9+
// This can't make sense as it would copy the classes
710
let i <- [r(0)];
811
let j <- [r(1)];
912
let k = i + j;

0 commit comments

Comments
 (0)