]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized-locals/box-fnonce.rs
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
[rust.git] / src / test / ui / unsized-locals / box-fnonce.rs
1 // run-pass
2
3 fn call_it<T>(f: Box<dyn FnOnce() -> T>) -> T {
4     f()
5 }
6
7 fn main() {
8     let s = "hello".to_owned();
9     assert_eq!(&call_it(Box::new(|| s)) as &str, "hello");
10 }