1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // pretty-expanded FIXME #23616
13 #![allow(dead_assignment)]
14 #![allow(unused_variable)]
15 #![allow(unknown_features)]
16 #![feature(box_syntax)]
18 struct A { a: isize, b: isize }
19 struct Abox { a: Box<isize>, b: Box<isize> }
21 fn ret_int_i() -> isize { 10 }
23 fn ret_ext_i() -> Box
<isize> { box 10 }
25 fn ret_int_rec() -> A { A {a: 10, b: 10}
}
27 fn ret_ext_rec() -> Box
<A
> { box A {a: 10, b: 10}
}
29 fn ret_ext_mem() -> Abox { Abox {a: box 10, b: box 10}
}
31 fn ret_ext_ext_mem() -> Box
<Abox
> { box Abox{a: box 10, b: box 10}
}
35 let mut ext_i
: Box
<isize>;
37 let mut ext_rec
: Box
<A
>;
38 let mut ext_mem
: Abox
;
39 let mut ext_ext_mem
: Box
<Abox
>;
40 int_i
= ret_int_i(); // initializing
42 int_i
= ret_int_i(); // non-initializing
44 int_i
= ret_int_i(); // non-initializing
46 ext_i
= ret_ext_i(); // initializing
48 ext_i
= ret_ext_i(); // non-initializing
50 ext_i
= ret_ext_i(); // non-initializing
52 int_rec
= ret_int_rec(); // initializing
54 int_rec
= ret_int_rec(); // non-initializing
56 int_rec
= ret_int_rec(); // non-initializing
58 ext_rec
= ret_ext_rec(); // initializing
60 ext_rec
= ret_ext_rec(); // non-initializing
62 ext_rec
= ret_ext_rec(); // non-initializing
64 ext_mem
= ret_ext_mem(); // initializing
66 ext_mem
= ret_ext_mem(); // non-initializing
68 ext_mem
= ret_ext_mem(); // non-initializing
70 ext_ext_mem
= ret_ext_ext_mem(); // initializing
72 ext_ext_mem
= ret_ext_ext_mem(); // non-initializing
74 ext_ext_mem
= ret_ext_ext_mem(); // non-initializing