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