2023-12-18 17:55:55 +01:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
2024-10-26 20:54:38 +00:00
|
|
|
--> $DIR/unstable-const-fn-in-libcore.rs:19:32
|
2019-12-05 15:02:41 +01:00
|
|
|
|
|
2022-09-17 13:31:04 +00:00
|
|
|
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
|
2024-10-26 20:54:38 +00:00
|
|
|
| ^^^^^^
|
2019-12-05 15:02:41 +01:00
|
|
|
|
2024-10-20 19:49:11 +00:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
2024-10-26 20:54:38 +00:00
|
|
|
--> $DIR/unstable-const-fn-in-libcore.rs:19:32
|
2024-10-20 19:49:11 +00:00
|
|
|
|
|
|
|
|
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
|
2024-10-26 20:54:38 +00:00
|
|
|
| ^^^^^^
|
2024-10-20 19:49:11 +00:00
|
|
|
|
|
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
|
|
|
|
2024-02-01 22:45:00 +00:00
|
|
|
error[E0015]: cannot call non-const closure in constant functions
|
|
|
|
--> $DIR/unstable-const-fn-in-libcore.rs:24:26
|
|
|
|
|
|
|
|
|
LL | Opt::None => f(),
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
|
|
help: consider further restricting this bound
|
|
|
|
|
|
2024-05-29 21:42:40 +00:00
|
|
|
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T + ~const FnOnce()>(self, f: F) -> T {
|
|
|
|
| +++++++++++++++++
|
2024-02-01 22:45:00 +00:00
|
|
|
|
|
|
|
error[E0493]: destructor of `F` cannot be evaluated at compile-time
|
|
|
|
--> $DIR/unstable-const-fn-in-libcore.rs:19:60
|
|
|
|
|
|
|
|
|
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
|
|
|
|
| ^ the destructor for this type cannot be evaluated in constant functions
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - value is dropped here
|
|
|
|
|
|
|
|
error[E0493]: destructor of `Opt<T>` cannot be evaluated at compile-time
|
|
|
|
--> $DIR/unstable-const-fn-in-libcore.rs:19:54
|
|
|
|
|
|
|
|
|
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
|
|
|
|
| ^^^^ the destructor for this type cannot be evaluated in constant functions
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - value is dropped here
|
|
|
|
|
2024-10-20 19:49:11 +00:00
|
|
|
error: aborting due to 5 previous errors
|
2019-12-05 15:02:41 +01:00
|
|
|
|
2024-02-01 22:45:00 +00:00
|
|
|
Some errors have detailed explanations: E0015, E0493.
|
|
|
|
For more information about an error, try `rustc --explain E0015`.
|