PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/output-slot-variants.rs

http://github.com/jruderman/rust
Rust | 58 lines | 32 code | 26 blank | 0 comment | 0 complexity | c3b017d60617fd39a0a0a548a3335570 MD5 | raw file
 1
 2
 3fn ret_int_i() -> int { return 10; }
 4
 5fn ret_ext_i() -> @int { return @10; }
 6
 7fn ret_int_rec() -> {a: int, b: int} { return {a: 10, b: 10}; }
 8
 9fn ret_ext_rec() -> @{a: int, b: int} { return @{a: 10, b: 10}; }
10
11fn ret_ext_mem() -> {a: @int, b: @int} { return {a: @10, b: @10}; }
12
13fn ret_ext_ext_mem() -> @{a: @int, b: @int} { return @{a: @10, b: @10}; }
14
15fn main() {
16    let mut int_i: int;
17    let mut ext_i: @int;
18    let mut int_rec: {a: int, b: int};
19    let mut ext_rec: @{a: int, b: int};
20    let mut ext_mem: {a: @int, b: @int};
21    let mut ext_ext_mem: @{a: @int, b: @int};
22    int_i = ret_int_i(); // initializing
23
24    int_i = ret_int_i(); // non-initializing
25
26    int_i = ret_int_i(); // non-initializing
27
28    ext_i = ret_ext_i(); // initializing
29
30    ext_i = ret_ext_i(); // non-initializing
31
32    ext_i = ret_ext_i(); // non-initializing
33
34    int_rec = ret_int_rec(); // initializing
35
36    int_rec = ret_int_rec(); // non-initializing
37
38    int_rec = ret_int_rec(); // non-initializing
39
40    ext_rec = ret_ext_rec(); // initializing
41
42    ext_rec = ret_ext_rec(); // non-initializing
43
44    ext_rec = ret_ext_rec(); // non-initializing
45
46    ext_mem = ret_ext_mem(); // initializing
47
48    ext_mem = ret_ext_mem(); // non-initializing
49
50    ext_mem = ret_ext_mem(); // non-initializing
51
52    ext_ext_mem = ret_ext_ext_mem(); // initializing
53
54    ext_ext_mem = ret_ext_ext_mem(); // non-initializing
55
56    ext_ext_mem = ret_ext_ext_mem(); // non-initializing
57
58}