2019-07-27 00:54:25 +03:00
|
|
|
//@ run-pass
|
|
|
|
|
2018-09-14 12:20:28 +02:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_assignments)]
|
|
|
|
#![allow(unknown_lints)]
|
2015-03-22 13:13:15 -07:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2014-04-14 21:00:31 +05:30
|
|
|
#![allow(dead_assignment)]
|
2016-08-13 02:41:43 -07:00
|
|
|
#![allow(unused_variables)]
|
2013-08-17 08:37:42 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
struct A { a: isize, b: isize }
|
|
|
|
struct Abox { a: Box<isize>, b: Box<isize> }
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
fn ret_int_i() -> isize { 10 }
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2021-08-25 02:39:40 +02:00
|
|
|
fn ret_ext_i() -> Box<isize> { Box::new(10) }
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2014-10-02 08:10:09 +03:00
|
|
|
fn ret_int_rec() -> A { A {a: 10, b: 10} }
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2021-08-25 02:39:40 +02:00
|
|
|
fn ret_ext_rec() -> Box<A> { Box::new(A {a: 10, b: 10}) }
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2021-08-25 02:39:40 +02:00
|
|
|
fn ret_ext_mem() -> Abox { Abox {a: Box::new(10), b: Box::new(10) } }
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2021-08-25 02:39:40 +02:00
|
|
|
fn ret_ext_ext_mem() -> Box<Abox> { Box::new(Abox{a: Box::new(10), b: Box::new(10) }) }
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2015-03-25 17:06:52 -07:00
|
|
|
let mut int_i: isize;
|
|
|
|
let mut ext_i: Box<isize>;
|
2013-01-25 22:46:32 -08:00
|
|
|
let mut int_rec: A;
|
2014-10-02 08:10:09 +03:00
|
|
|
let mut ext_rec: Box<A>;
|
2013-01-25 22:46:32 -08:00
|
|
|
let mut ext_mem: Abox;
|
2014-10-02 08:10:09 +03:00
|
|
|
let mut ext_ext_mem: Box<Abox>;
|
2011-06-15 11:19:50 -07:00
|
|
|
int_i = ret_int_i(); // initializing
|
|
|
|
|
|
|
|
int_i = ret_int_i(); // non-initializing
|
|
|
|
|
|
|
|
int_i = ret_int_i(); // non-initializing
|
|
|
|
|
|
|
|
ext_i = ret_ext_i(); // initializing
|
|
|
|
|
|
|
|
ext_i = ret_ext_i(); // non-initializing
|
|
|
|
|
|
|
|
ext_i = ret_ext_i(); // non-initializing
|
|
|
|
|
2011-07-26 14:49:40 +02:00
|
|
|
int_rec = ret_int_rec(); // initializing
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2011-07-26 14:49:40 +02:00
|
|
|
int_rec = ret_int_rec(); // non-initializing
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2011-07-26 14:49:40 +02:00
|
|
|
int_rec = ret_int_rec(); // non-initializing
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2011-07-26 14:49:40 +02:00
|
|
|
ext_rec = ret_ext_rec(); // initializing
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2011-07-26 14:49:40 +02:00
|
|
|
ext_rec = ret_ext_rec(); // non-initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-07-26 14:49:40 +02:00
|
|
|
ext_rec = ret_ext_rec(); // non-initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
ext_mem = ret_ext_mem(); // initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
ext_mem = ret_ext_mem(); // non-initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
ext_mem = ret_ext_mem(); // non-initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
ext_ext_mem = ret_ext_ext_mem(); // initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
ext_ext_mem = ret_ext_ext_mem(); // non-initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
ext_ext_mem = ret_ext_ext_mem(); // non-initializing
|
2010-06-24 13:32:59 -07:00
|
|
|
|
2011-08-19 15:16:48 -07:00
|
|
|
}
|