1 #![allow(incomplete_features)]
2 #![feature(unsized_locals, unsized_fn_params)]
6 fn gen_foo() -> Box<fmt::Display> {
7 Box::new(Box::new("foo"))
10 fn foo(x: fmt::Display) {
11 assert_eq!(x.to_string(), "foo");
14 fn foo_indirect(x: fmt::Display) {
20 foo_indirect(*gen_foo());
23 let x: fmt::Display = *gen_foo();
28 let x: fmt::Display = *gen_foo();
29 let y: fmt::Display = *gen_foo();
35 let mut cnt: usize = 3;
37 let x: fmt::Display = *gen_foo();
48 let x: fmt::Display = *gen_foo();
49 let x = if true { x } else { *gen_foo() };