File: normalize-tait-in-const.stderr

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,245,360 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (32 lines) | stat: -rw-r--r-- 1,534 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
error: `~const` can only be applied to `#[const_trait]` traits
  --> $DIR/normalize-tait-in-const.rs:25:42
   |
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
   |                                          ^^^^^^^^^^^^^^^^^

error[E0015]: cannot call non-const closure in constant functions
  --> $DIR/normalize-tait-in-const.rs:26:5
   |
LL |     fun(filter_positive());
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
   = help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound
   |
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const std::ops::Fn<(&Alias<'_>,)>>(fun: F) {
   |                                                                              ++++++++++++++++++++++++++++++++++++

error[E0493]: destructor of `F` cannot be evaluated at compile-time
  --> $DIR/normalize-tait-in-const.rs:25:79
   |
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

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0015, E0493.
For more information about an error, try `rustc --explain E0015`.