summary refs log tree commit diff
path: root/src/test/ui/borrowck/two-phase-method-receivers.rs
blob: 6838f6c7efd5d24f36df3baba576f0cffebe866c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// compile-flags: -Z borrowck=mir

// run-pass

struct Foo<'a> {
    x: &'a i32
}

impl<'a> Foo<'a> {
    fn method(&mut self, _: &i32) {
    }
}

fn main() {
    let a = &mut Foo { x: &22 };
    Foo::method(a, a.x);
}