241 lines
7.6 KiB
Plaintext
241 lines
7.6 KiB
Plaintext
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:15:1
|
||
|
|
|
|
||
|
|
15 | / fn foo() { //~ ERROR function cannot return without recurring
|
||
|
|
16 | | foo(); //~ NOTE recursive call site
|
||
|
|
17 | | }
|
||
|
|
| |_^
|
||
|
|
|
|
||
|
|
note: lint level defined here
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:11:9
|
||
|
|
|
|
||
|
|
11 | #![deny(unconditional_recursion)]
|
||
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:16:5
|
||
|
|
|
|
||
|
|
16 | foo(); //~ NOTE recursive call site
|
||
|
|
| ^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:25:1
|
||
|
|
|
|
||
|
|
25 | / fn baz() { //~ ERROR function cannot return without recurring
|
||
|
|
26 | | if true {
|
||
|
|
27 | | baz() //~ NOTE recursive call site
|
||
|
|
28 | | } else {
|
||
|
|
29 | | baz() //~ NOTE recursive call site
|
||
|
|
30 | | }
|
||
|
|
31 | | }
|
||
|
|
| |_^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:27:9
|
||
|
|
|
|
||
|
|
27 | baz() //~ NOTE recursive call site
|
||
|
|
| ^^^^^
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:29:9
|
||
|
|
|
|
||
|
|
29 | baz() //~ NOTE recursive call site
|
||
|
|
| ^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:37:1
|
||
|
|
|
|
||
|
|
37 | / fn quz() -> bool { //~ ERROR function cannot return without recurring
|
||
|
|
38 | | if true {
|
||
|
|
39 | | while quz() {} //~ NOTE recursive call site
|
||
|
|
40 | | true
|
||
|
|
... |
|
||
|
|
43 | | }
|
||
|
|
44 | | }
|
||
|
|
| |_^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:39:15
|
||
|
|
|
|
||
|
|
39 | while quz() {} //~ NOTE recursive call site
|
||
|
|
| ^^^^^
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:42:16
|
||
|
|
|
|
||
|
|
42 | loop { quz(); } //~ NOTE recursive call site
|
||
|
|
| ^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:48:5
|
||
|
|
|
|
||
|
|
48 | / fn bar(&self) { //~ ERROR function cannot return without recurring
|
||
|
|
49 | | self.bar() //~ NOTE recursive call site
|
||
|
|
50 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:49:9
|
||
|
|
|
|
||
|
|
49 | self.bar() //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:54:5
|
||
|
|
|
|
||
|
|
54 | / fn bar(&self) { //~ ERROR function cannot return without recurring
|
||
|
|
55 | | loop {
|
||
|
|
56 | | self.bar() //~ NOTE recursive call site
|
||
|
|
57 | | }
|
||
|
|
58 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:56:13
|
||
|
|
|
|
||
|
|
56 | self.bar() //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:63:5
|
||
|
|
|
|
||
|
|
63 | / fn bar(&self) { //~ ERROR function cannot return without recurring
|
||
|
|
64 | | 0.bar() //~ NOTE recursive call site
|
||
|
|
65 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:64:9
|
||
|
|
|
|
||
|
|
64 | 0.bar() //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:76:5
|
||
|
|
|
|
||
|
|
76 | / fn bar(&self) { //~ ERROR function cannot return without recurring
|
||
|
|
77 | | Foo2::bar(self) //~ NOTE recursive call site
|
||
|
|
78 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:77:9
|
||
|
|
|
|
||
|
|
77 | Foo2::bar(self) //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^^^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:82:5
|
||
|
|
|
|
||
|
|
82 | / fn bar(&self) { //~ ERROR function cannot return without recurring
|
||
|
|
83 | | loop {
|
||
|
|
84 | | Foo2::bar(self) //~ NOTE recursive call site
|
||
|
|
85 | | }
|
||
|
|
86 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:84:13
|
||
|
|
|
|
||
|
|
84 | Foo2::bar(self) //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^^^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:92:5
|
||
|
|
|
|
||
|
|
92 | / fn qux(&self) { //~ ERROR function cannot return without recurring
|
||
|
|
93 | | self.qux(); //~ NOTE recursive call site
|
||
|
|
94 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:93:9
|
||
|
|
|
|
||
|
|
93 | self.qux(); //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:97:5
|
||
|
|
|
|
||
|
|
97 | / fn as_ref(&self) -> &Self { //~ ERROR function cannot return without recurring
|
||
|
|
98 | | Baz::as_ref(self) //~ NOTE recursive call site
|
||
|
|
99 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:98:9
|
||
|
|
|
|
||
|
|
98 | Baz::as_ref(self) //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^^^^^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:104:5
|
||
|
|
|
|
||
|
|
104 | / fn default() -> Baz { //~ ERROR function cannot return without recurring
|
||
|
|
105 | | let x = Default::default(); //~ NOTE recursive call site
|
||
|
|
106 | | x
|
||
|
|
107 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:105:17
|
||
|
|
|
|
||
|
|
105 | let x = Default::default(); //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^^^^^^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:113:5
|
||
|
|
|
|
||
|
|
113 | / fn deref(&self) -> &() { //~ ERROR function cannot return without recurring
|
||
|
|
114 | | &**self //~ NOTE recursive call site
|
||
|
|
115 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:114:10
|
||
|
|
|
|
||
|
|
114 | &**self //~ NOTE recursive call site
|
||
|
|
| ^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:120:5
|
||
|
|
|
|
||
|
|
120 | / fn index(&self, x: usize) -> &Baz { //~ ERROR function cannot return without recurring
|
||
|
|
121 | | &self[x] //~ NOTE recursive call site
|
||
|
|
122 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:121:10
|
||
|
|
|
|
||
|
|
121 | &self[x] //~ NOTE recursive call site
|
||
|
|
| ^^^^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: function cannot return without recurring
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:129:5
|
||
|
|
|
|
||
|
|
129 | / fn deref(&self) -> &Baz { //~ ERROR function cannot return without recurring
|
||
|
|
130 | | self.as_ref() //~ NOTE recursive call site
|
||
|
|
131 | | }
|
||
|
|
| |_____^
|
||
|
|
|
|
||
|
|
note: recursive call site
|
||
|
|
--> $DIR/lint-unconditional-recursion.rs:130:9
|
||
|
|
|
|
||
|
|
130 | self.as_ref() //~ NOTE recursive call site
|
||
|
|
| ^^^^
|
||
|
|
= help: a `loop` may express intention better if this is on purpose
|
||
|
|
|
||
|
|
error: aborting due to 14 previous errors
|
||
|
|
|