rust/src/test/ui/regions/regions-escape-into-other-fn.rs

11 lines
185 B
Rust
Raw Normal View History

// run-pass
#![feature(box_syntax)]
fn foo(x: &usize) -> &usize { x }
fn bar(x: &usize) -> usize { *x }
pub fn main() {
let p: Box<_> = box 3;
assert_eq!(bar(foo(&*p)), 3);
}