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