]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr
use hir::Place instead of Symbol in closure_kind_origin
[rust.git] / src / test / ui / closures / 2229_closure_analysis / diagnostics / closure-origin-tuple-diagnostics.stderr
1 warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
2   --> $DIR/closure-origin-tuple-diagnostics.rs:1:12
3    |
4 LL | #![feature(capture_disjoint_fields)]
5    |            ^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `#[warn(incomplete_features)]` on by default
8    = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
9
10 error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
11   --> $DIR/closure-origin-tuple-diagnostics.rs:11:13
12    |
13 LL |     let c = || {
14    |             ^^ this closure implements `FnOnce`, not `Fn`
15 LL |         let s = s.1;
16    |                 --- closure is `FnOnce` because it moves the variable `s.1` out of its environment
17 LL |     };
18 LL |     expect_fn(c);
19    |     --------- the requirement to implement `Fn` derives from here
20
21 error: aborting due to previous error; 1 warning emitted
22
23 For more information about this error, try `rustc --explain E0525`.