2018-07-15 21:11:54 +00:00
|
|
|
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/issue-34349.rs:16:17
|
2018-07-15 21:11:54 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | let diary = || {
|
2018-07-15 21:11:54 +00:00
|
|
|
| ^^ this closure implements `FnMut`, not `Fn`
|
|
|
|
LL | farewell.push_str("!!!");
|
|
|
|
| -------- closure is `FnMut` because it mutates the variable `farewell` here
|
|
|
|
...
|
|
|
|
LL | apply(diary);
|
2022-08-18 12:22:07 +00:00
|
|
|
| ----- ----- the requirement to implement `Fn` derives from here
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
|
|
|
|
|
|
|
|
note: required by a bound in `apply`
|
|
|
|
--> $DIR/issue-34349.rs:11:32
|
|
|
|
|
|
|
|
|
LL | fn apply<F>(f: F) where F: Fn() {
|
|
|
|
| ^^^^ required by this bound in `apply`
|
2018-07-15 21:11:54 +00:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0525`.
|