rust/tests/ui/borrowck/two-phase-multi-mut.rs
2023-01-11 09:32:08 +00:00

15 lines
283 B
Rust

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
}