rust/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs

14 lines
275 B
Rust
Raw Normal View History

type point = { x: int, y: int };
type character = { pos: ~point };
fn get_x(x: &r/character) -> &r/int {
// interesting case because the scope of this
// borrow of the unique pointer is in fact
// larger than the fn itself
2012-08-01 19:30:05 -05:00
return &x.pos.x;
}
fn main() {
}