File tree 2 files changed +13
-9
lines changed
2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ LL | pub fn f(b: &mut i32) {
11
11
| ^^^^^^^^
12
12
help: try removing `&mut` here
13
13
|
14
- LL | h(b);
15
- | --
14
+ LL - h(&mut b);
15
+ LL + h(b);
16
+ |
16
17
17
18
error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
18
19
--> $DIR/mut-borrow-of-mut-ref.rs:11:12
@@ -27,8 +28,9 @@ LL | pub fn f(b: &mut i32) {
27
28
| ^^^^^^^^
28
29
help: try removing `&mut` here
29
30
|
30
- LL | g(&mut b);
31
- | --
31
+ LL - g(&mut &mut b);
32
+ LL + g(&mut b);
33
+ |
32
34
33
35
error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
34
36
--> $DIR/mut-borrow-of-mut-ref.rs:18:12
@@ -43,8 +45,9 @@ LL | pub fn g(b: &mut i32) {
43
45
| ^^^^^^^^
44
46
help: try removing `&mut` here
45
47
|
46
- LL | h(&mut b);
47
- | --
48
+ LL - h(&mut &mut b);
49
+ LL + h(&mut b);
50
+ |
48
51
49
52
error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
50
53
--> $DIR/mut-borrow-of-mut-ref.rs:35:5
@@ -55,7 +58,7 @@ LL | f.bar();
55
58
help: consider making the binding mutable
56
59
|
57
60
LL | pub fn baz(mut f: &mut String) {
58
- | ^^^
61
+ | +++
59
62
60
63
error: aborting due to 4 previous errors
61
64
Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ LL | fn start(&mut self) {
11
11
| ^^^^^^^^^
12
12
help: try removing `&mut` here
13
13
|
14
- LL | self.run(self);
15
- | --
14
+ LL - self.run(&mut self);
15
+ LL + self.run(self);
16
+ |
16
17
17
18
error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable
18
19
--> $DIR/issue-34126.rs:6:18
You can’t perform that action at this time.
0 commit comments