]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/output-slot-variants.rs
Convert unknown_features lint into an error
[rust.git] / src / test / run-pass / output-slot-variants.rs
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.
4 //
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.
10
11 // pretty-expanded FIXME #23616
12
13 #![allow(dead_assignment)]
14 #![allow(unused_variables)]
15 #![feature(box_syntax)]
16
17 struct A { a: isize, b: isize }
18 struct Abox { a: Box<isize>, b: Box<isize> }
19
20 fn ret_int_i() -> isize { 10 }
21
22 fn ret_ext_i() -> Box<isize> { box 10 }
23
24 fn ret_int_rec() -> A { A {a: 10, b: 10} }
25
26 fn ret_ext_rec() -> Box<A> { box A {a: 10, b: 10} }
27
28 fn ret_ext_mem() -> Abox { Abox {a: box 10, b: box 10} }
29
30 fn ret_ext_ext_mem() -> Box<Abox> { box Abox{a: box 10, b: box 10} }
31
32 pub fn main() {
33     let mut int_i: isize;
34     let mut ext_i: Box<isize>;
35     let mut int_rec: A;
36     let mut ext_rec: Box<A>;
37     let mut ext_mem: Abox;
38     let mut ext_ext_mem: Box<Abox>;
39     int_i = ret_int_i(); // initializing
40
41     int_i = ret_int_i(); // non-initializing
42
43     int_i = ret_int_i(); // non-initializing
44
45     ext_i = ret_ext_i(); // initializing
46
47     ext_i = ret_ext_i(); // non-initializing
48
49     ext_i = ret_ext_i(); // non-initializing
50
51     int_rec = ret_int_rec(); // initializing
52
53     int_rec = ret_int_rec(); // non-initializing
54
55     int_rec = ret_int_rec(); // non-initializing
56
57     ext_rec = ret_ext_rec(); // initializing
58
59     ext_rec = ret_ext_rec(); // non-initializing
60
61     ext_rec = ret_ext_rec(); // non-initializing
62
63     ext_mem = ret_ext_mem(); // initializing
64
65     ext_mem = ret_ext_mem(); // non-initializing
66
67     ext_mem = ret_ext_mem(); // non-initializing
68
69     ext_ext_mem = ret_ext_ext_mem(); // initializing
70
71     ext_ext_mem = ret_ext_ext_mem(); // non-initializing
72
73     ext_ext_mem = ret_ext_ext_mem(); // non-initializing
74
75 }