about summary refs log tree commit diff
path: root/tests/ui/borrowck/two-phase-multi-mut.rs
blob: 8ff924ccc2a89860482edb2e317f367eec9e2baf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct Foo {
}

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

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