]> git.lizzy.rs Git - rust.git/blob - tests/ui/did_you_mean/issue-34126.rs
Account for method call and indexing when looking for inner-most path in expression
[rust.git] / tests / ui / did_you_mean / issue-34126.rs
1 struct Z { }
2
3 impl Z {
4     fn run(&self, z: &mut Z) { }
5     fn start(&mut self) {
6         self.run(&mut self); //~ ERROR cannot borrow
7         //~| ERROR cannot borrow
8         //~| HELP try removing `&mut` here
9     }
10 }
11
12 fn main() {
13     let mut z = Z {};
14     z.start();
15 }