summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/lint-unconditional-recursion.stderr
blob: 9d200a7898eb235ddd86df6c3169ff2e88c2274f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:4:1
   |
LL | fn foo() {
   | ^^^^^^^^ cannot return without recursing
LL |     foo();
   |     ----- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose
note: the lint level is defined here
  --> $DIR/lint-unconditional-recursion.rs:1:9
   |
LL | #![deny(unconditional_recursion)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:14:1
   |
LL | fn baz() {
   | ^^^^^^^^ cannot return without recursing
LL |     if true {
LL |         baz()
   |         ----- recursive call site
LL |     } else {
LL |         baz()
   |         ----- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:26:1
   |
LL | fn quz() -> bool {
   | ^^^^^^^^^^^^^^^^ cannot return without recursing
LL |     if true {
LL |         while quz() {}
   |               ----- recursive call site
...
LL |         loop { quz(); }
   |                ----- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:37:5
   |
LL |     fn bar(&self) {
   |     ^^^^^^^^^^^^^ cannot return without recursing
LL |         self.bar()
   |         ---------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:43:5
   |
LL |     fn bar(&self) {
   |     ^^^^^^^^^^^^^ cannot return without recursing
LL |         loop {
LL |             self.bar()
   |             ---------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:52:5
   |
LL |     fn bar(&self) {
   |     ^^^^^^^^^^^^^ cannot return without recursing
LL |         0.bar()
   |         ------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:65:5
   |
LL |     fn bar(&self) {
   |     ^^^^^^^^^^^^^ cannot return without recursing
LL |         Foo2::bar(self)
   |         --------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:71:5
   |
LL |     fn bar(&self) {
   |     ^^^^^^^^^^^^^ cannot return without recursing
LL |         loop {
LL |             Foo2::bar(self)
   |             --------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:81:5
   |
LL |     fn qux(&self) {
   |     ^^^^^^^^^^^^^ cannot return without recursing
LL |         self.qux();
   |         ---------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:86:5
   |
LL |     fn as_ref(&self) -> &Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |         Baz::as_ref(self)
   |         ----------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:93:5
   |
LL |     fn default() -> Baz {
   |     ^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |         let x = Default::default();
   |                 ------------------ recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:102:5
   |
LL |     fn deref(&self) -> &() {
   |     ^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |         &**self
   |          ------ recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:109:5
   |
LL |     fn index(&self, x: usize) -> &Baz {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |         &self[x]
   |          ------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:118:5
   |
LL |     fn deref(&self) -> &Baz {
   |     ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |         self.as_ref()
   |         ------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:162:1
   |
LL | pub fn drop_and_replace(mut a: Option<String>) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |     a = None;
LL |     drop_and_replace(a);
   |     ------------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:168:1
   |
LL | pub fn call() -> String {
   | ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |     let s = String::new();
LL |     call();
   |     ------ recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:175:1
   |
LL | pub fn overflow_check(a: i32, b: i32) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
LL |     let _ = a + b;
LL |     overflow_check(a, b);
   |     -------------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: function cannot return without recursing
  --> $DIR/lint-unconditional-recursion.rs:186:5
   |
LL |     fn default() -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
...
LL |             ..Default::default()
   |               ------------------ recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

error: aborting due to 18 previous errors