File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 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) {
1111   |             ^^^^^^^^
1212help: try removing `&mut` here
1313   |
14- LL |     h(b);
15-    |      --
14+ LL -     h(&mut b);
15+ LL +     h(b);
16+    | 
1617
1718error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
1819  --> $DIR/mut-borrow-of-mut-ref.rs:11:12
@@ -27,8 +28,9 @@ LL | pub fn f(b: &mut i32) {
2728   |             ^^^^^^^^
2829help: try removing `&mut` here
2930   |
30- LL |     g(&mut b);
31-    |           --
31+ LL -     g(&mut &mut b);
32+ LL +     g(&mut b);
33+    | 
3234
3335error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
3436  --> $DIR/mut-borrow-of-mut-ref.rs:18:12
@@ -43,8 +45,9 @@ LL | pub fn g(b: &mut i32) {
4345   |             ^^^^^^^^
4446help: try removing `&mut` here
4547   |
46- LL |     h(&mut b);
47-    |           --
48+ LL -     h(&mut &mut b);
49+ LL +     h(&mut b);
50+    | 
4851
4952error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
5053  --> $DIR/mut-borrow-of-mut-ref.rs:35:5
@@ -55,7 +58,7 @@ LL |     f.bar();
5558help: consider making the binding mutable
5659   |
5760LL | pub fn baz(mut f: &mut String) {
58-    |            ^^^ 
61+    |            +++ 
5962
6063error: aborting due to 4 previous errors
6164
Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ LL |     fn start(&mut self) {
1111   |              ^^^^^^^^^
1212help: try removing `&mut` here
1313   |
14- LL |         self.run(self);
15-    |                 --
14+ LL -         self.run(&mut self);
15+ LL +         self.run(self);
16+    | 
1617
1718error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable
1819  --> $DIR/issue-34126.rs:6:18
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments