File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
- #![ allow( unconditional_recursion) ]
2
-
3
1
struct Struct ;
4
2
5
3
impl Struct {
6
4
fn bar ( self : & mut Self ) {
5
+ //~^ WARN function cannot return without recursing
6
+ //~^^ HELP a `loop` may express intention better if this is on purpose
7
7
( & mut self ) . bar ( ) ;
8
8
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
9
9
//~^^ HELP try removing `&mut` here
Original file line number Diff line number Diff line change
1
+ warning: function cannot return without recursing
2
+ --> $DIR/issue-51191.rs:4:5
3
+ |
4
+ LL | fn bar(self: &mut Self) {
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
6
+ ...
7
+ LL | (&mut self).bar();
8
+ | ----------------- recursive call site
9
+ |
10
+ = note: `#[warn(unconditional_recursion)]` on by default
11
+ = help: a `loop` may express intention better if this is on purpose
12
+
1
13
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
2
14
--> $DIR/issue-51191.rs:7:9
3
15
|
@@ -36,6 +48,6 @@ LL | (&mut self).bar();
36
48
| cannot borrow as mutable
37
49
| help: try removing `&mut` here
38
50
39
- error: aborting due to 5 previous errors
51
+ error: aborting due to 5 previous errors; 1 warning emitted
40
52
41
53
For more information about this error, try `rustc --explain E0596`.
You can’t perform that action at this time.
0 commit comments