]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/min_const_fn/min_const_fn.stderr
Reword const fn conditional and loop error text
[rust.git] / src / test / ui / consts / min_const_fn / min_const_fn.stderr
1 error[E0493]: destructors cannot be evaluated at compile-time
2   --> $DIR/min_const_fn.rs:37:25
3    |
4 LL |     const fn into_inner(self) -> T { self.0 }
5    |                         ^^^^ constant functions cannot evaluate destructors
6
7 error[E0723]: mutable references in const fn are unstable
8   --> $DIR/min_const_fn.rs:39:36
9    |
10 LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
11    |                                    ^^^^^^
12    |
13    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
14    = help: add #![feature(const_fn)] to the crate attributes to enable
15
16 error[E0493]: destructors cannot be evaluated at compile-time
17   --> $DIR/min_const_fn.rs:44:28
18    |
19 LL |     const fn into_inner_lt(self) -> T { self.0 }
20    |                            ^^^^ constant functions cannot evaluate destructors
21
22 error[E0723]: mutable references in const fn are unstable
23   --> $DIR/min_const_fn.rs:46:42
24    |
25 LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
26    |                                          ^^^^^^
27    |
28    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
29    = help: add #![feature(const_fn)] to the crate attributes to enable
30
31 error[E0493]: destructors cannot be evaluated at compile-time
32   --> $DIR/min_const_fn.rs:51:27
33    |
34 LL |     const fn into_inner_s(self) -> T { self.0 }
35    |                           ^^^^ constant functions cannot evaluate destructors
36
37 error[E0723]: mutable references in const fn are unstable
38   --> $DIR/min_const_fn.rs:53:38
39    |
40 LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
41    |                                      ^^^^^^
42    |
43    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
44    = help: add #![feature(const_fn)] to the crate attributes to enable
45
46 error[E0723]: mutable references in const fn are unstable
47   --> $DIR/min_const_fn.rs:58:39
48    |
49 LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
50    |                                       ^^^^^^
51    |
52    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
53    = help: add #![feature(const_fn)] to the crate attributes to enable
54
55 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
56   --> $DIR/min_const_fn.rs:76:16
57    |
58 LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
59    |                ^
60    |
61    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
62    = help: add #![feature(const_fn)] to the crate attributes to enable
63
64 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
65   --> $DIR/min_const_fn.rs:78:18
66    |
67 LL | const fn foo11_2<T: Send>(t: T) -> T { t }
68    |                  ^
69    |
70    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
71    = help: add #![feature(const_fn)] to the crate attributes to enable
72
73 error[E0723]: only int, `bool` and `char` operations are stable in const fn
74   --> $DIR/min_const_fn.rs:80:33
75    |
76 LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
77    |                                 ^^^^^^^
78    |
79    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
80    = help: add #![feature(const_fn)] to the crate attributes to enable
81
82 error[E0723]: only int, `bool` and `char` operations are stable in const fn
83   --> $DIR/min_const_fn.rs:82:35
84    |
85 LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
86    |                                   ^^^^^^^
87    |
88    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
89    = help: add #![feature(const_fn)] to the crate attributes to enable
90
91 error[E0723]: only int and `bool` operations are stable in const fn
92   --> $DIR/min_const_fn.rs:84:35
93    |
94 LL | const fn foo19_3(f: f32) -> f32 { -f }
95    |                                   ^^
96    |
97    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
98    = help: add #![feature(const_fn)] to the crate attributes to enable
99
100 error[E0723]: only int, `bool` and `char` operations are stable in const fn
101   --> $DIR/min_const_fn.rs:86:43
102    |
103 LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
104    |                                           ^^^^^
105    |
106    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
107    = help: add #![feature(const_fn)] to the crate attributes to enable
108
109 error[E0723]: cannot access `static` items in const fn
110   --> $DIR/min_const_fn.rs:90:27
111    |
112 LL | const fn foo25() -> u32 { BAR }
113    |                           ^^^
114    |
115    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
116    = help: add #![feature(const_fn)] to the crate attributes to enable
117
118 error[E0723]: cannot access `static` items in const fn
119   --> $DIR/min_const_fn.rs:91:36
120    |
121 LL | const fn foo26() -> &'static u32 { &BAR }
122    |                                    ^^^^
123    |
124    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
125    = help: add #![feature(const_fn)] to the crate attributes to enable
126
127 error[E0723]: casting pointers to ints is unstable in const fn
128   --> $DIR/min_const_fn.rs:92:42
129    |
130 LL | const fn foo30(x: *const u32) -> usize { x as usize }
131    |                                          ^^^^^^^^^^
132    |
133    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
134    = help: add #![feature(const_fn)] to the crate attributes to enable
135
136 error[E0723]: casting pointers to ints is unstable in const fn
137   --> $DIR/min_const_fn.rs:94:63
138    |
139 LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
140    |                                                               ^^^^^^^^^^
141    |
142    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
143    = help: add #![feature(const_fn)] to the crate attributes to enable
144
145 error[E0723]: casting pointers to ints is unstable in const fn
146   --> $DIR/min_const_fn.rs:96:42
147    |
148 LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
149    |                                          ^^^^^^^^^^
150    |
151    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
152    = help: add #![feature(const_fn)] to the crate attributes to enable
153
154 error[E0723]: casting pointers to ints is unstable in const fn
155   --> $DIR/min_const_fn.rs:98:63
156    |
157 LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
158    |                                                               ^^^^^^^^^^
159    |
160    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
161    = help: add #![feature(const_fn)] to the crate attributes to enable
162
163 error[E0723]: loops and conditional expressions are not stable in const fn
164   --> $DIR/min_const_fn.rs:100:38
165    |
166 LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }
167    |                                      ^^^^^^^^^^^^^^^^^^^^^^
168    |
169    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
170    = help: add #![feature(const_fn)] to the crate attributes to enable
171
172 error[E0723]: loops and conditional expressions are not stable in const fn
173   --> $DIR/min_const_fn.rs:102:29
174    |
175 LL | const fn foo30_5(b: bool) { while b { } }
176    |                             ^^^^^^^^^^^
177    |
178    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
179    = help: add #![feature(const_fn)] to the crate attributes to enable
180
181 error[E0723]: loops and conditional expressions are not stable in const fn
182   --> $DIR/min_const_fn.rs:104:44
183    |
184 LL | const fn foo36(a: bool, b: bool) -> bool { a && b }
185    |                                            ^^^^^^
186    |
187    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
188    = help: add #![feature(const_fn)] to the crate attributes to enable
189
190 error[E0723]: loops and conditional expressions are not stable in const fn
191   --> $DIR/min_const_fn.rs:106:44
192    |
193 LL | const fn foo37(a: bool, b: bool) -> bool { a || b }
194    |                                            ^^^^^^
195    |
196    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
197    = help: add #![feature(const_fn)] to the crate attributes to enable
198
199 error[E0723]: mutable references in const fn are unstable
200   --> $DIR/min_const_fn.rs:108:14
201    |
202 LL | const fn inc(x: &mut i32) { *x += 1 }
203    |              ^
204    |
205    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
206    = help: add #![feature(const_fn)] to the crate attributes to enable
207
208 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
209   --> $DIR/min_const_fn.rs:113:6
210    |
211 LL | impl<T: std::fmt::Debug> Foo<T> {
212    |      ^
213    |
214    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
215    = help: add #![feature(const_fn)] to the crate attributes to enable
216
217 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
218   --> $DIR/min_const_fn.rs:118:6
219    |
220 LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
221    |      ^
222    |
223    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
224    = help: add #![feature(const_fn)] to the crate attributes to enable
225
226 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
227   --> $DIR/min_const_fn.rs:123:6
228    |
229 LL | impl<T: Sync + Sized> Foo<T> {
230    |      ^
231    |
232    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
233    = help: add #![feature(const_fn)] to the crate attributes to enable
234
235 error[E0723]: `impl Trait` in const fn is unstable
236   --> $DIR/min_const_fn.rs:129:24
237    |
238 LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }
239    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
240    |
241    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
242    = help: add #![feature(const_fn)] to the crate attributes to enable
243
244 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
245   --> $DIR/min_const_fn.rs:131:34
246    |
247 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
248    |                                  ^^^^^^^^^^^^^^^^^^^^
249    |
250    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
251    = help: add #![feature(const_fn)] to the crate attributes to enable
252
253 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
254   --> $DIR/min_const_fn.rs:133:22
255    |
256 LL | const fn no_apit(_x: impl std::fmt::Debug) {}
257    |                      ^^^^^^^^^^^^^^^^^^^^
258    |
259    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
260    = help: add #![feature(const_fn)] to the crate attributes to enable
261
262 error[E0723]: `impl Trait` in const fn is unstable
263   --> $DIR/min_const_fn.rs:134:23
264    |
265 LL | const fn no_rpit() -> impl std::fmt::Debug {}
266    |                       ^^^^^^^^^^^^^^^^^^^^
267    |
268    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
269    = help: add #![feature(const_fn)] to the crate attributes to enable
270
271 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
272   --> $DIR/min_const_fn.rs:135:23
273    |
274 LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {}
275    |                       ^^
276    |
277    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
278    = help: add #![feature(const_fn)] to the crate attributes to enable
279
280 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
281   --> $DIR/min_const_fn.rs:136:32
282    |
283 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
284    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
285    |
286    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
287    = help: add #![feature(const_fn)] to the crate attributes to enable
288
289 warning[E0515]: cannot return reference to temporary value
290   --> $DIR/min_const_fn.rs:136:63
291    |
292 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
293    |                                                               ^--
294    |                                                               ||
295    |                                                               |temporary value created here
296    |                                                               returns a reference to data owned by the current function
297    |
298    = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
299    = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
300    = note: for more information, try `rustc --explain E0729`
301
302 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
303   --> $DIR/min_const_fn.rs:144:41
304    |
305 LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
306    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
307    |
308    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
309    = help: add #![feature(const_fn)] to the crate attributes to enable
310
311 error[E0723]: function pointers in const fn are unstable
312   --> $DIR/min_const_fn.rs:147:21
313    |
314 LL | const fn no_fn_ptrs(_x: fn()) {}
315    |                     ^^
316    |
317    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
318    = help: add #![feature(const_fn)] to the crate attributes to enable
319
320 error[E0723]: function pointers in const fn are unstable
321   --> $DIR/min_const_fn.rs:149:27
322    |
323 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
324    |                           ^^^^
325    |
326    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
327    = help: add #![feature(const_fn)] to the crate attributes to enable
328
329 error: aborting due to 36 previous errors
330
331 Some errors have detailed explanations: E0515, E0723.
332 For more information about an error, try `rustc --explain E0515`.