]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-ref-in-fn-arg.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / regions / regions-ref-in-fn-arg.rs
1 #![feature(box_patterns)]
2 #![feature(box_syntax)]
3
4 fn arg_item(box ref x: Box<isize>) -> &'static isize {
5     x //~^ ERROR borrowed value does not live long enough
6 }
7
8 fn with<R, F>(f: F) -> R where F: FnOnce(Box<isize>) -> R { f(box 3) }
9
10 fn arg_closure() -> &'static isize {
11     with(|box ref x| x) //~ ERROR borrowed value does not live long enough
12 }
13
14 fn main() {}