mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
16 lines
271 B
Rust
16 lines
271 B
Rust
struct Z { }
|
|
|
|
impl Z {
|
|
fn run(&self, z: &mut Z) { }
|
|
fn start(&mut self) {
|
|
self.run(&mut self); //~ ERROR cannot borrow
|
|
//~| ERROR cannot borrow
|
|
//~| HELP try removing `&mut` here
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let mut z = Z {};
|
|
z.start();
|
|
}
|