rust/tests/ui/regions/regions-borrow-uniq.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
148 B
Rust
Raw Permalink Normal View History

//@ run-pass
fn foo(x: &usize) -> usize {
2012-04-13 20:36:39 +00:00
*x
}
pub fn main() {
let p: Box<_> = Box::new(3);
let r = foo(&*p);
assert_eq!(r, 3);
2012-04-13 20:36:39 +00:00
}