3 #![allow(incomplete_features)]
4 #![feature(unsized_locals, unsized_fn_params)]
7 fn foo(self) -> String;
11 fn foo(self) -> String {
17 fn foo(self) -> String {
22 impl Foo for dyn FnMut() -> String {
23 fn foo(mut self) -> String {
29 let x = *(Box::new(['h', 'e', 'l', 'l', 'o']) as Box<[char]>);
30 assert_eq!(&x.foo() as &str, "hello");
32 let x = Box::new(['h', 'e', 'l', 'l', 'o']) as Box<[char]>;
33 assert_eq!(&x.foo() as &str, "hello");
35 let x = "hello".to_owned().into_boxed_str();
36 assert_eq!(&x.foo() as &str, "hello");
38 let x = *("hello".to_owned().into_boxed_str());
39 assert_eq!(&x.foo() as &str, "hello");
41 let x = "hello".to_owned().into_boxed_str();
42 assert_eq!(&x.foo() as &str, "hello");
44 let x = *(Box::new(|| "hello".to_owned()) as Box<dyn FnMut() -> String>);
45 assert_eq!(&x.foo() as &str, "hello");
47 let x = Box::new(|| "hello".to_owned()) as Box<dyn FnMut() -> String>;
48 assert_eq!(&x.foo() as &str, "hello");