]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/lint-unconditional-recursion.stderr
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / ui / lint / lint-unconditional-recursion.stderr
1 error: function cannot return without recursing
2   --> $DIR/lint-unconditional-recursion.rs:4:1
3    |
4 LL | fn foo() {
5    | ^^^^^^^^ cannot return without recursing
6 LL |     foo();
7    |     ----- recursive call site
8    |
9    = help: a `loop` may express intention better if this is on purpose
10 note: the lint level is defined here
11   --> $DIR/lint-unconditional-recursion.rs:1:9
12    |
13 LL | #![deny(unconditional_recursion)]
14    |         ^^^^^^^^^^^^^^^^^^^^^^^
15
16 error: function cannot return without recursing
17   --> $DIR/lint-unconditional-recursion.rs:14:1
18    |
19 LL | fn baz() {
20    | ^^^^^^^^ cannot return without recursing
21 LL |     if true {
22 LL |         baz()
23    |         ----- recursive call site
24 LL |     } else {
25 LL |         baz()
26    |         ----- recursive call site
27    |
28    = help: a `loop` may express intention better if this is on purpose
29
30 error: function cannot return without recursing
31   --> $DIR/lint-unconditional-recursion.rs:26:1
32    |
33 LL | fn quz() -> bool {
34    | ^^^^^^^^^^^^^^^^ cannot return without recursing
35 LL |     if true {
36 LL |         while quz() {}
37    |               ----- recursive call site
38 ...
39 LL |         loop { quz(); }
40    |                ----- recursive call site
41    |
42    = help: a `loop` may express intention better if this is on purpose
43
44 error: function cannot return without recursing
45   --> $DIR/lint-unconditional-recursion.rs:37:5
46    |
47 LL |     fn bar(&self) {
48    |     ^^^^^^^^^^^^^ cannot return without recursing
49 LL |         self.bar()
50    |         ---------- recursive call site
51    |
52    = help: a `loop` may express intention better if this is on purpose
53
54 error: function cannot return without recursing
55   --> $DIR/lint-unconditional-recursion.rs:43:5
56    |
57 LL |     fn bar(&self) {
58    |     ^^^^^^^^^^^^^ cannot return without recursing
59 LL |         loop {
60 LL |             self.bar()
61    |             ---------- recursive call site
62    |
63    = help: a `loop` may express intention better if this is on purpose
64
65 error: function cannot return without recursing
66   --> $DIR/lint-unconditional-recursion.rs:52:5
67    |
68 LL |     fn bar(&self) {
69    |     ^^^^^^^^^^^^^ cannot return without recursing
70 LL |         0.bar()
71    |         ------- recursive call site
72    |
73    = help: a `loop` may express intention better if this is on purpose
74
75 error: function cannot return without recursing
76   --> $DIR/lint-unconditional-recursion.rs:65:5
77    |
78 LL |     fn bar(&self) {
79    |     ^^^^^^^^^^^^^ cannot return without recursing
80 LL |         Foo2::bar(self)
81    |         --------------- recursive call site
82    |
83    = help: a `loop` may express intention better if this is on purpose
84
85 error: function cannot return without recursing
86   --> $DIR/lint-unconditional-recursion.rs:71:5
87    |
88 LL |     fn bar(&self) {
89    |     ^^^^^^^^^^^^^ cannot return without recursing
90 LL |         loop {
91 LL |             Foo2::bar(self)
92    |             --------------- recursive call site
93    |
94    = help: a `loop` may express intention better if this is on purpose
95
96 error: function cannot return without recursing
97   --> $DIR/lint-unconditional-recursion.rs:81:5
98    |
99 LL |     fn qux(&self) {
100    |     ^^^^^^^^^^^^^ cannot return without recursing
101 LL |         self.qux();
102    |         ---------- recursive call site
103    |
104    = help: a `loop` may express intention better if this is on purpose
105
106 error: function cannot return without recursing
107   --> $DIR/lint-unconditional-recursion.rs:86:5
108    |
109 LL |     fn as_ref(&self) -> &Self {
110    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
111 LL |         Baz::as_ref(self)
112    |         ----------------- recursive call site
113    |
114    = help: a `loop` may express intention better if this is on purpose
115
116 error: function cannot return without recursing
117   --> $DIR/lint-unconditional-recursion.rs:93:5
118    |
119 LL |     fn default() -> Baz {
120    |     ^^^^^^^^^^^^^^^^^^^ cannot return without recursing
121 LL |         let x = Default::default();
122    |                 ------------------ recursive call site
123    |
124    = help: a `loop` may express intention better if this is on purpose
125
126 error: function cannot return without recursing
127   --> $DIR/lint-unconditional-recursion.rs:102:5
128    |
129 LL |     fn deref(&self) -> &() {
130    |     ^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
131 LL |         &**self
132    |          ------ recursive call site
133    |
134    = help: a `loop` may express intention better if this is on purpose
135
136 error: function cannot return without recursing
137   --> $DIR/lint-unconditional-recursion.rs:109:5
138    |
139 LL |     fn index(&self, x: usize) -> &Baz {
140    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
141 LL |         &self[x]
142    |          ------- recursive call site
143    |
144    = help: a `loop` may express intention better if this is on purpose
145
146 error: function cannot return without recursing
147   --> $DIR/lint-unconditional-recursion.rs:118:5
148    |
149 LL |     fn deref(&self) -> &Baz {
150    |     ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
151 LL |         self.as_ref()
152    |         ------------- recursive call site
153    |
154    = help: a `loop` may express intention better if this is on purpose
155
156 error: function cannot return without recursing
157   --> $DIR/lint-unconditional-recursion.rs:162:1
158    |
159 LL | pub fn drop_and_replace(mut a: Option<String>) {
160    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
161 LL |     a = None;
162 LL |     drop_and_replace(a);
163    |     ------------------- recursive call site
164    |
165    = help: a `loop` may express intention better if this is on purpose
166
167 error: function cannot return without recursing
168   --> $DIR/lint-unconditional-recursion.rs:168:1
169    |
170 LL | pub fn call() -> String {
171    | ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
172 LL |     let s = String::new();
173 LL |     call();
174    |     ------ recursive call site
175    |
176    = help: a `loop` may express intention better if this is on purpose
177
178 error: function cannot return without recursing
179   --> $DIR/lint-unconditional-recursion.rs:175:1
180    |
181 LL | pub fn overflow_check(a: i32, b: i32) {
182    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
183 LL |     let _ = a + b;
184 LL |     overflow_check(a, b);
185    |     -------------------- recursive call site
186    |
187    = help: a `loop` may express intention better if this is on purpose
188
189 error: function cannot return without recursing
190   --> $DIR/lint-unconditional-recursion.rs:186:5
191    |
192 LL |     fn default() -> Self {
193    |     ^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
194 ...
195 LL |             ..Default::default()
196    |               ------------------ recursive call site
197    |
198    = help: a `loop` may express intention better if this is on purpose
199
200 error: aborting due to 18 previous errors
201