fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
5.0 KiB157 linesraw
1error: function cannot return without recursing
2  --> $DIR/lint-unconditional-recursion.rs:4:1
3   |
4LL | fn foo() {
5   | ^^^^^^^^ cannot return without recursing
6LL |     foo();
7   |     ----- recursive call site
8   |
9note: lint level defined here
10  --> $DIR/lint-unconditional-recursion.rs:1:9
11   |
12LL | #![deny(unconditional_recursion)]
13   |         ^^^^^^^^^^^^^^^^^^^^^^^
14   = help: a `loop` may express intention better if this is on purpose
15
16error: function cannot return without recursing
17  --> $DIR/lint-unconditional-recursion.rs:14:1
18   |
19LL | fn baz() {
20   | ^^^^^^^^ cannot return without recursing
21LL |     if true {
22LL |         baz()
23   |         ----- recursive call site
24LL |     } else {
25LL |         baz()
26   |         ----- recursive call site
27   |
28   = help: a `loop` may express intention better if this is on purpose
29
30error: function cannot return without recursing
31  --> $DIR/lint-unconditional-recursion.rs:26:1
32   |
33LL | fn quz() -> bool {
34   | ^^^^^^^^^^^^^^^^ cannot return without recursing
35LL |     if true {
36LL |         while quz() {}
37   |               ----- recursive call site
38...
39LL |         loop { quz(); }
40   |                ----- recursive call site
41   |
42   = help: a `loop` may express intention better if this is on purpose
43
44error: function cannot return without recursing
45  --> $DIR/lint-unconditional-recursion.rs:37:5
46   |
47LL |     fn bar(&self) {
48   |     ^^^^^^^^^^^^^ cannot return without recursing
49LL |         self.bar()
50   |         ---------- recursive call site
51   |
52   = help: a `loop` may express intention better if this is on purpose
53
54error: function cannot return without recursing
55  --> $DIR/lint-unconditional-recursion.rs:43:5
56   |
57LL |     fn bar(&self) {
58   |     ^^^^^^^^^^^^^ cannot return without recursing
59LL |         loop {
60LL |             self.bar()
61   |             ---------- recursive call site
62   |
63   = help: a `loop` may express intention better if this is on purpose
64
65error: function cannot return without recursing
66  --> $DIR/lint-unconditional-recursion.rs:52:5
67   |
68LL |     fn bar(&self) {
69   |     ^^^^^^^^^^^^^ cannot return without recursing
70LL |         0.bar()
71   |         ------- recursive call site
72   |
73   = help: a `loop` may express intention better if this is on purpose
74
75error: function cannot return without recursing
76  --> $DIR/lint-unconditional-recursion.rs:65:5
77   |
78LL |     fn bar(&self) {
79   |     ^^^^^^^^^^^^^ cannot return without recursing
80LL |         Foo2::bar(self)
81   |         --------------- recursive call site
82   |
83   = help: a `loop` may express intention better if this is on purpose
84
85error: function cannot return without recursing
86  --> $DIR/lint-unconditional-recursion.rs:71:5
87   |
88LL |     fn bar(&self) {
89   |     ^^^^^^^^^^^^^ cannot return without recursing
90LL |         loop {
91LL |             Foo2::bar(self)
92   |             --------------- recursive call site
93   |
94   = help: a `loop` may express intention better if this is on purpose
95
96error: function cannot return without recursing
97  --> $DIR/lint-unconditional-recursion.rs:81:5
98   |
99LL |     fn qux(&self) {
100   |     ^^^^^^^^^^^^^ cannot return without recursing
101LL |         self.qux();
102   |         ---------- recursive call site
103   |
104   = help: a `loop` may express intention better if this is on purpose
105
106error: function cannot return without recursing
107  --> $DIR/lint-unconditional-recursion.rs:86:5
108   |
109LL |     fn as_ref(&self) -> &Self {
110   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
111LL |         Baz::as_ref(self)
112   |         ----------------- recursive call site
113   |
114   = help: a `loop` may express intention better if this is on purpose
115
116error: function cannot return without recursing
117  --> $DIR/lint-unconditional-recursion.rs:93:5
118   |
119LL |     fn default() -> Baz {
120   |     ^^^^^^^^^^^^^^^^^^^ cannot return without recursing
121LL |         let x = Default::default();
122   |                 ------------------ recursive call site
123   |
124   = help: a `loop` may express intention better if this is on purpose
125
126error: function cannot return without recursing
127  --> $DIR/lint-unconditional-recursion.rs:102:5
128   |
129LL |     fn deref(&self) -> &() {
130   |     ^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
131LL |         &**self
132   |          ------ recursive call site
133   |
134   = help: a `loop` may express intention better if this is on purpose
135
136error: function cannot return without recursing
137  --> $DIR/lint-unconditional-recursion.rs:109:5
138   |
139LL |     fn index(&self, x: usize) -> &Baz {
140   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
141LL |         &self[x]
142   |          ------- recursive call site
143   |
144   = help: a `loop` may express intention better if this is on purpose
145
146error: function cannot return without recursing
147  --> $DIR/lint-unconditional-recursion.rs:118:5
148   |
149LL |     fn deref(&self) -> &Baz {
150   |     ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
151LL |         self.as_ref()
152   |         ---- recursive call site
153   |
154   = help: a `loop` may express intention better if this is on purpose
155
156error: aborting due to 14 previous errors
157