]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/unstable-const-fn-in-libcore.stderr
Tweak move error
[rust.git] / src / test / ui / consts / unstable-const-fn-in-libcore.stderr
1 error[E0015]: cannot call non-const closure in constant functions
2   --> $DIR/unstable-const-fn-in-libcore.rs:24:26
3    |
4 LL |             Opt::None => f(),
5    |                          ^^^
6    |
7    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
8 help: consider further restricting this bound
9    |
10 LL |     const fn unwrap_or_else<F: FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T {
11    |                                              +++++++++++++++++++++++++++++
12
13 error[E0493]: destructors cannot be evaluated at compile-time
14   --> $DIR/unstable-const-fn-in-libcore.rs:19:53
15    |
16 LL |     const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
17    |                                                     ^ constant functions cannot evaluate destructors
18 ...
19 LL |     }
20    |     - value is dropped here
21
22 error[E0493]: destructors cannot be evaluated at compile-time
23   --> $DIR/unstable-const-fn-in-libcore.rs:19:47
24    |
25 LL |     const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
26    |                                               ^^^^ constant functions cannot evaluate destructors
27 ...
28 LL |     }
29    |     - value is dropped here
30
31 error: aborting due to 3 previous errors
32
33 Some errors have detailed explanations: E0015, E0493.
34 For more information about an error, try `rustc --explain E0015`.