mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-30 23:17:32 +00:00
15 lines
288 B
Rust
15 lines
288 B
Rust
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
|
|
}
|