mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
15 lines
369 B
Rust
15 lines
369 B
Rust
#![feature(box_patterns)]
|
|
|
|
|
|
fn arg_item(box ref x: Box<isize>) -> &'static isize {
|
|
x //~ ERROR cannot return value referencing function parameter
|
|
}
|
|
|
|
fn with<R, F>(f: F) -> R where F: FnOnce(Box<isize>) -> R { f(Box::new(3)) }
|
|
|
|
fn arg_closure() -> &'static isize {
|
|
with(|box ref x| x) //~ ERROR cannot return value referencing function parameter
|
|
}
|
|
|
|
fn main() {}
|