|
1 | | -error: `~const` can only be applied to `#[const_trait]` traits |
2 | | - --> $DIR/normalize-tait-in-const.rs:27:42 |
| 1 | +error: expected a trait, found type |
| 2 | + --> $DIR/normalize-tait-in-const.rs:27:34 |
3 | 3 | | |
4 | 4 | LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { |
5 | | - | ^^^^^^^^^^^^^^^^^ |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | 6 |
|
7 | | -error: `~const` can only be applied to `#[const_trait]` traits |
8 | | - --> $DIR/normalize-tait-in-const.rs:27:69 |
9 | | - | |
10 | | -LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { |
11 | | - | ^^^^^^^^ |
12 | | - |
13 | | -error[E0015]: cannot call non-const closure in constant functions |
14 | | - --> $DIR/normalize-tait-in-const.rs:28:5 |
15 | | - | |
16 | | -LL | fun(filter_positive()); |
17 | | - | ^^^^^^^^^^^^^^^^^^^^^^ |
18 | | - | |
19 | | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants |
20 | | -help: consider further restricting this bound |
21 | | - | |
22 | | -LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const Fn(&foo::Alias<'_>)>(fun: F) { |
23 | | - | ++++++++++++++++++++++++++++ |
24 | | -help: add `#![feature(effects)]` to the crate attributes to enable |
25 | | - | |
26 | | -LL + #![feature(effects)] |
27 | | - | |
28 | | - |
29 | | -error[E0493]: destructor of `F` cannot be evaluated at compile-time |
30 | | - --> $DIR/normalize-tait-in-const.rs:27:79 |
31 | | - | |
32 | | -LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { |
33 | | - | ^^^ the destructor for this type cannot be evaluated in constant functions |
34 | | -LL | fun(filter_positive()); |
35 | | -LL | } |
36 | | - | - value is dropped here |
37 | | - |
38 | | -error: aborting due to 4 previous errors |
| 7 | +error: aborting due to 1 previous error |
39 | 8 |
|
40 | | -Some errors have detailed explanations: E0015, E0493. |
41 | | -For more information about an error, try `rustc --explain E0015`. |
0 commit comments