rust/tests/ui/did_you_mean/issue-34126.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
271 B
Rust
Raw Normal View History

2016-11-02 01:15:02 -05:00
struct Z { }
impl Z {
fn run(&self, z: &mut Z) { }
fn start(&mut self) {
2017-11-20 06:13:27 -06:00
self.run(&mut self); //~ ERROR cannot borrow
//~| ERROR cannot borrow
//~| HELP try removing `&mut` here
2016-11-02 01:15:02 -05:00
}
}
fn main() {
let mut z = Z {};
z.start();
}