2023-12-18 16:55:55 +00:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
2024-06-10 16:17:38 +00:00
|
|
|
--> $DIR/normalize-tait-in-const.rs:27:42
|
2023-07-29 08:20:25 +00:00
|
|
|
|
|
2023-08-13 09:02:31 +00:00
|
|
|
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
2023-07-29 08:20:25 +00:00
|
|
|
|
2024-06-21 11:57:24 +00:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
|
|
|
--> $DIR/normalize-tait-in-const.rs:27:69
|
|
|
|
|
|
|
|
|
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
2024-02-01 22:45:00 +00:00
|
|
|
error[E0015]: cannot call non-const closure in constant functions
|
2024-06-10 16:17:38 +00:00
|
|
|
--> $DIR/normalize-tait-in-const.rs:28:5
|
2024-02-01 22:45:00 +00:00
|
|
|
|
|
|
|
|
LL | fun(filter_positive());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
|
|
help: consider further restricting this bound
|
|
|
|
|
|
2024-06-10 16:17:38 +00:00
|
|
|
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const Fn(&foo::Alias<'_>)>(fun: F) {
|
|
|
|
| ++++++++++++++++++++++++++++
|
2024-03-07 22:09:00 +00:00
|
|
|
help: add `#![feature(effects)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
LL + #![feature(effects)]
|
|
|
|
|
|
2024-02-01 22:45:00 +00:00
|
|
|
|
|
|
|
error[E0493]: destructor of `F` cannot be evaluated at compile-time
|
2024-06-10 16:17:38 +00:00
|
|
|
--> $DIR/normalize-tait-in-const.rs:27:79
|
2024-02-01 22:45:00 +00:00
|
|
|
|
|
|
|
|
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
|
|
|
|
| ^^^ the destructor for this type cannot be evaluated in constant functions
|
|
|
|
LL | fun(filter_positive());
|
|
|
|
LL | }
|
|
|
|
| - value is dropped here
|
|
|
|
|
2024-06-21 11:57:24 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2022-10-25 02:11:24 +00: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`.
|