]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/two-phase-multi-mut.rs
Rollup merge of #107580 - lenko-d:default_value_for_a_lifetime_generic_parameter_prod...
[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 }