2015-02-10 22:52:00 +01:00
|
|
|
#![feature(box_patterns)]
|
2021-08-25 02:39:40 +02:00
|
|
|
|
2014-05-05 18:56:44 -07:00
|
|
|
|
2015-01-08 21:54:35 +11:00
|
|
|
fn arg_item(box ref x: Box<isize>) -> &'static isize {
|
2019-04-22 08:40:08 +01:00
|
|
|
x //~ ERROR cannot return value referencing function parameter
|
2013-06-20 15:11:47 -04:00
|
|
|
}
|
|
|
|
|
|
2021-08-25 02:39:40 +02:00
|
|
|
fn with<R, F>(f: F) -> R where F: FnOnce(Box<isize>) -> R { f(Box::new(3)) }
|
2013-06-20 15:11:47 -04:00
|
|
|
|
2015-01-08 21:54:35 +11:00
|
|
|
fn arg_closure() -> &'static isize {
|
2019-04-22 08:40:08 +01:00
|
|
|
with(|box ref x| x) //~ ERROR cannot return value referencing function parameter
|
2013-06-20 15:11:47 -04:00
|
|
|
}
|
|
|
|
|
|
2013-09-23 17:20:36 -07:00
|
|
|
fn main() {}
|