]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-51191.rs
fix merge conflicts
[rust.git] / src / test / ui / nll / issue-51191.rs
1 struct Struct;
2
3 impl Struct {
4     fn bar(self: &mut Self) {
5         //~^ WARN function cannot return without recursing
6         (&mut self).bar();
7         //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
8     }
9
10     fn imm(self) {
11         (&mut self).bar();
12         //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
13     }
14
15     fn mtbl(mut self) {
16         (&mut self).bar();
17     }
18
19     fn immref(&self) {
20         (&mut self).bar();
21         //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
22         //~^^ ERROR cannot borrow data in a `&` reference as mutable [E0596]
23     }
24
25     fn mtblref(&mut self) {
26         (&mut self).bar();
27         //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
28     }
29 }
30
31 fn main () {}