]> git.lizzy.rs Git - rust.git/blob - src/test/run-fail/morestack3.rs
dd52986c4a40386f96ecc735c7bf9794c80e5504
[rust.git] / src / test / run-fail / morestack3.rs
1 // error-pattern:explicit failure
2
3 // Just testing unwinding
4
5 use std;
6
7 fn getbig_and_fail(&&i: int) {
8     let r = and_then_get_big_again(@0);
9     if i != 0 {
10         getbig_and_fail(i - 1);
11     } else {
12         fail;
13     }
14 }
15
16 resource and_then_get_big_again(_i: @int) {
17     fn getbig(i: int) {
18         if i != 0 {
19             getbig(i - 1);
20         }
21     }
22     getbig(100);
23 }
24
25 fn main() {
26     task::spawn(400, getbig_and_fail);
27 }