File: kind-due-to-rpit.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 934,168 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (17 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
error[E0525]: expected a closure that implements the `AsyncFn` trait, but this closure only implements `AsyncFnOnce`
  --> $DIR/kind-due-to-rpit.rs:7:20
   |
LL | fn repro(foo: impl Into<bool>) -> impl AsyncFn() {
   |                                   -------------- the requirement to implement `AsyncFn` derives from here
LL |     let inner_fn = async move || {
   |                    ^^^^^^^^^^^^^ this closure implements `AsyncFnOnce`, not `AsyncFn`
LL |
LL |         let _ = foo.into();
   |                 --- closure is `AsyncFnOnce` because it moves the variable `foo` out of its environment
LL |     };
LL |     inner_fn
   |     -------- return type was inferred to be `{async closure@$DIR/kind-due-to-rpit.rs:7:20: 7:33}` here

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0525`.