summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-addr-of-interior-of-unique-box.rs
blob: 4221ebfdffb2b06f3887a867fdf67163362d547c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// run-pass
#![allow(dead_code)]

// pretty-expanded FIXME #23616

struct Point {
    x: isize,
    y: isize
}

struct Character {
    pos: Box<Point>,
}

fn get_x(x: &Character) -> &isize {
    // interesting case because the scope of this
    // borrow of the unique pointer is in fact
    // larger than the fn itself
    return &x.pos.x;
}

pub fn main() {
}