about summary refs log tree commit diff
path: root/tests/ui/borrowck/two-phase-method-receivers.rs
blob: 147b70d0cfbf4a360e2bd22b1044fbce3eb7e200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ 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);
}