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