]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closure_context/issue-26046-fn-once.stderr
report the total number of errors on compilation failure
[rust.git] / src / test / ui / closure_context / issue-26046-fn-once.stderr
1 error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
2   --> $DIR/issue-26046-fn-once.rs:14:19
3    |
4 14 |       let closure = move || {
5    |  ___________________^
6 15 | |         vec
7 16 | |     };
8    | |_____^
9 17 | 
10 18 |       Box::new(closure)
11    |       ----------------- the requirement to implement `Fn` derives from here
12    |
13 note: closure is `FnOnce` because it moves the variable `vec` out of its environment
14   --> $DIR/issue-26046-fn-once.rs:15:9
15    |
16 15 |         vec
17    |         ^^^
18
19 error: aborting due to previous error
20