Skip to content

Commit df5e516

Browse files
committed
remove allow(unconditional_recursion)
1 parent 880e691 commit df5e516

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/test/ui/nll/issue-51191.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#![allow(unconditional_recursion)]
2-
31
struct Struct;
42

53
impl Struct {
64
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
77
(&mut self).bar();
88
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
99
//~^^ HELP try removing `&mut` here

src/test/ui/nll/issue-51191.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
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+
113
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
214
--> $DIR/issue-51191.rs:7:9
315
|
@@ -36,6 +48,6 @@ LL | (&mut self).bar();
3648
| cannot borrow as mutable
3749
| help: try removing `&mut` here
3850

39-
error: aborting due to 5 previous errors
51+
error: aborting due to 5 previous errors; 1 warning emitted
4052

4153
For more information about this error, try `rustc --explain E0596`.

0 commit comments

Comments
 (0)