]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized-locals/box-fnonce.rs
Auto merge of #106925 - imWildCat:imWildCat/remove-hardcoded-ios-macbi-target-version...
[rust.git] / tests / 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 }