summary refs log tree commit diff
path: root/src/test/ui/borrowck/two-phase-multi-mut.rs
blob: ed3d257da9f0f4f469bcfe77786775490f8da40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![feature(nll)]

struct Foo {
}

impl Foo {
    fn method(&mut self, foo: &mut Foo) {
    }
}

fn main() {
    let mut foo = Foo { };
    foo.method(&mut foo);
    //~^     cannot borrow `foo` as mutable more than once at a time
    //~^^    cannot borrow `foo` as mutable more than once at a time
}