Skip to content

Commit f067637

Browse files
committed
---
yaml --- r: 13261 b: refs/heads/master c: 7daf986 h: refs/heads/master i: 13259: ec18c53 v: v3
1 parent 18ee3b5 commit f067637

10 files changed

+48
-26
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: ebde93861fc004aec9d1fdac528cca9aad9a7612
2+
refs/heads/master: 7daf986aeca81a72be5869a5a41d4fde753eca0f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/test/run-fail/morestack2.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ fn getbig_call_c_and_fail(i: int) {
2020
}
2121
}
2222

23-
resource and_then_get_big_again(_i: ()) {
23+
class and_then_get_big_again {
24+
new() {}
25+
drop {
2426
fn getbig(i: int) {
2527
if i != 0 {
2628
getbig(i - 1);
2729
}
2830
}
2931
getbig(10000);
32+
}
3033
}
3134

3235
fn main() {
3336
task::spawn {||
34-
let r = and_then_get_big_again(());
37+
let r = and_then_get_big_again();
3538
getbig_call_c_and_fail(10000);
3639
};
3740
}

trunk/src/test/run-fail/morestack3.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@
55
use std;
66

77
fn getbig_and_fail(&&i: int) {
8-
let r = and_then_get_big_again(@0);
8+
let _r = and_then_get_big_again();
99
if i != 0 {
1010
getbig_and_fail(i - 1);
1111
} else {
1212
fail;
1313
}
1414
}
1515

16-
resource and_then_get_big_again(_i: @int) {
16+
class and_then_get_big_again {
17+
new() {}
18+
drop {
1719
fn getbig(i: int) {
1820
if i != 0 {
1921
getbig(i - 1);
2022
}
2123
}
2224
getbig(100);
25+
}
2326
}
2427

2528
fn main() {

trunk/src/test/run-fail/morestack4.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
use std;
66

77
fn getbig_and_fail(&&i: int) {
8-
let r = and_then_get_big_again(@0);
8+
let r = and_then_get_big_again();
99
if i != 0 {
1010
getbig_and_fail(i - 1);
1111
} else {
1212
fail;
1313
}
1414
}
1515

16-
resource and_then_get_big_again(_i: @int) {
16+
class and_then_get_big_again {
17+
new() {}
18+
drop {}
1719
}
1820

1921
fn main() {
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
// error-pattern:whatever
22

3-
fn main() {
4-
log(error, "whatever");
5-
task::spawn {||
6-
resource r(_i: ()) {
3+
class r {
74
// Setting the exit status after the runtime has already
85
// failed has no effect and the process exits with the
96
// runtime's exit code
10-
os::set_exit_status(50);
11-
}
12-
let i = r(());
7+
drop {
8+
os::set_exit_status(50);
9+
}
10+
new() {}
11+
}
12+
13+
fn main() {
14+
log(error, "whatever");
15+
task::spawn {||
16+
let i = r();
1317
};
1418
fail;
1519
}

trunk/src/test/run-fail/too-much-recursion-unwinding.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ fn recurse() {
99
recurse();
1010
}
1111

12-
resource r(recursed: *mut bool) unsafe {
12+
class r {
13+
let recursed: *mut bool;
14+
new(recursed: *mut bool) unsafe { self.recursed = recursed; }
15+
drop unsafe {
1316
if !*recursed {
1417
*recursed = true;
1518
recurse();
1619
}
20+
}
1721
}
1822

1923
fn main() {

trunk/src/test/run-fail/unwind-box-res.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ fn failfn() {
44
fail;
55
}
66

7-
resource r(v: *int) unsafe {
8-
let v2: ~int = unsafe::reinterpret_cast(v);
7+
class r {
8+
let v: *int;
9+
new(v: *int) { self.v = v; }
10+
drop unsafe {
11+
let _v2: ~int = unsafe::reinterpret_cast(self.v);
12+
}
913
}
1014

1115
fn main() unsafe {

trunk/src/test/run-fail/unwind-resource-fail.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// error-pattern:fail
22
// xfail-test
33

4-
resource r(i: int) {
5-
// What happens when destructors throw?
6-
fail;
4+
class r {
5+
new(i:int) {}
6+
drop { fail; }
77
}
88

99
fn main() {

trunk/src/test/run-fail/unwind-resource-fail2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// error-pattern:fail
22
// xfail-test
33

4-
resource r(i: int) {
5-
// Double-fail!!
6-
fail;
4+
class r {
5+
new(i:int) {}
6+
drop { fail; }
77
}
88

99
fn main() {

trunk/src/test/run-fail/unwind-resource-fail3.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// error-pattern:quux
22
// xfail-test
33

4-
resource faily_box(_i: @int) {
5-
// What happens to the box pointer owned by this resource?
6-
fail "quux";
4+
class faily_box {
5+
let i: @int;
6+
new(i: @int) { self.i = i; }
7+
// What happens to the box pointer owned by this class?
8+
drop { fail "quux"; }
79
}
810

911
fn main() {

0 commit comments

Comments
 (0)