2024-06-27 17:07:03 +00:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
2024-10-26 20:54:38 +00:00
|
|
|
--> $DIR/normalize-tait-in-const.rs:26:35
|
2023-07-29 08:20:25 +00:00
|
|
|
|
|
2024-06-27 17:07:03 +00:00
|
|
|
LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
|
2024-10-26 20:54:38 +00:00
|
|
|
| ^^^^^^
|
2023-07-29 08:20:25 +00: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/normalize-tait-in-const.rs:26:35
|
2024-10-20 19:49:11 +00:00
|
|
|
|
|
|
|
|
LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
|
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-11-24 00:30:16 +00:00
|
|
|
error[E0277]: the trait bound `for<'a, 'b> fn(&'a foo::Alias<'b>) {foo}: const Destruct` is not satisfied
|
2024-11-24 01:15:04 +00:00
|
|
|
--> $DIR/normalize-tait-in-const.rs:33:19
|
2024-10-20 19:49:11 +00:00
|
|
|
|
|
2024-11-24 00:30:16 +00:00
|
|
|
LL | with_positive(foo);
|
2024-11-24 01:15:04 +00:00
|
|
|
| ------------- ^^^
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
|
|
|
|
|
|
|
|
note: required by a bound in `with_positive`
|
|
|
|
--> $DIR/normalize-tait-in-const.rs:26:62
|
|
|
|
|
|
|
|
|
LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
|
|
|
|
| ^^^^^^ required by this bound in `with_positive`
|
2024-10-20 19:49:11 +00:00
|
|
|
|
2024-06-27 17:07:03 +00:00
|
|
|
error[E0015]: cannot call non-const closure in constant functions
|
2024-08-26 12:51:16 +00:00
|
|
|
--> $DIR/normalize-tait-in-const.rs:27:5
|
2024-06-27 17:07:03 +00:00
|
|
|
|
|
|
|
|
LL | fun(filter_positive());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
|
|
|
2024-11-24 00:30:16 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2022-10-25 02:11:24 +00:00
|
|
|
|
2024-11-24 00:30:16 +00:00
|
|
|
Some errors have detailed explanations: E0015, E0277.
|
2024-06-27 17:07:03 +00:00
|
|
|
For more information about an error, try `rustc --explain E0015`.
|