File tree 5 files changed +37
-33
lines changed
5 files changed +37
-33
lines changed Original file line number Diff line number Diff line change 1
- // xfail-test
2
1
// Fail statements without arguments need to be disambiguated in
3
2
// certain positions
4
- // error-pattern:explicit-failure
3
+ // error-pattern:oops
5
4
6
5
fn bigfail ( ) {
7
- do { while ( fail) { if ( fail) {
8
- match ( fail) { _ {
9
- } }
10
- } } } while fail;
6
+ while ( fail ~"oops") { if ( fail) {
7
+ match ( fail) { ( ) => {
8
+ }
9
+ }
10
+ } } ;
11
11
}
12
12
13
13
fn main ( ) { bigfail ( ) ; }
Original file line number Diff line number Diff line change 1
1
// error-pattern:ran out of stack
2
- // xfail-test - right now we leak when we fail during failure
3
2
4
3
// Test that the task fails after hiting the recursion limit
5
- // durnig unwinding
4
+ // during unwinding
6
5
7
6
fn recurse ( ) {
8
7
log ( debug, "don't optimize me out" ) ;
9
8
recurse ( ) ;
10
9
}
11
10
12
- class r {
13
- let recursed: * mut bool;
14
- new ( recursed : * mut bool ) unsafe { self . recursed = recursed ; }
15
- drop unsafe {
16
- if ! * recursed {
17
- * recursed = true ;
18
- recurse ( ) ;
11
+ struct r {
12
+ recursed : * mut bool ,
13
+ drop unsafe {
14
+ if ! * ( self . recursed ) {
15
+ * ( self . recursed ) = true ;
16
+ recurse ( ) ;
17
+ }
19
18
}
20
- }
19
+ }
20
+
21
+ fn r ( recursed : * mut bool ) -> r unsafe {
22
+ r { recursed : recursed }
21
23
}
22
24
23
25
fn main ( ) {
24
26
let mut recursed = false ;
25
- let _r = r ( ptr:: mut_addr_of ( recursed) ) ;
27
+ let _r = r ( ptr:: mut_addr_of ( & recursed) ) ;
26
28
recurse ( ) ;
27
29
}
Original file line number Diff line number Diff line change 1
- // error-pattern:fail
2
- // xfail-test
1
+ // error-pattern:squirrel
3
2
4
- class r {
5
- new ( i : int ) { }
6
- drop { fail; }
3
+ struct r {
4
+ i : int ,
5
+ drop { fail ~"squirrel" }
7
6
}
8
7
8
+ fn r ( i : int ) -> r { r { i : i } }
9
+
9
10
fn main ( ) {
10
11
@0 ;
11
12
let r = move r ( 0 ) ;
Original file line number Diff line number Diff line change 1
- // error-pattern:fail
2
- // xfail-test
1
+ // error-pattern:wombat
3
2
4
- class r {
5
- new ( i : int ) { }
6
- drop { fail; }
3
+ struct r {
4
+ i : int ,
5
+ drop { fail ~"wombat" }
7
6
}
8
7
8
+ fn r ( i : int ) -> r { r { i : i } }
9
+
9
10
fn main ( ) {
10
11
@0 ;
11
12
let r = move r ( 0 ) ;
Original file line number Diff line number Diff line change 1
1
// error-pattern:quux
2
- // xfail-test
3
2
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?
3
+ struct faily_box {
4
+ i : @int
8
5
}
6
+ // What happens to the box pointer owned by this class?
7
+
8
+ fn faily_box ( i : @int ) -> faily_box { faily_box { i : i } }
9
9
10
10
impl faily_box : Drop {
11
11
fn finalize ( ) {
12
- fail "quux" ;
12
+ fail ~ "quux";
13
13
}
14
14
}
15
15
You can’t perform that action at this time.
0 commit comments