]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/two-phase-multi-mut.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / two-phase-multi-mut.rs
1 struct Foo {
2 }
3
4 impl Foo {
5     fn method(&mut self, foo: &mut Foo) {
6     }
7 }
8
9 fn main() {
10     let mut foo = Foo { };
11     foo.method(&mut foo);
12     //~^     cannot borrow `foo` as mutable more than once at a time
13     //~^^    cannot borrow `foo` as mutable more than once at a time
14 }