os-rust/tests/ui/issues/issue-34349.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
834 B
Text
Raw Normal View History

2018-07-15 14:11:54 -07:00
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
2018-12-25 08:56:47 -07:00
--> $DIR/issue-34349.rs:16:17
2018-07-15 14:11:54 -07:00
|
2019-03-09 15:03:44 +03:00
LL | let diary = || {
2018-07-15 14:11:54 -07: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 14:11:54 -07:00
error: aborting due to 1 previous error
2018-07-15 14:11:54 -07:00
For more information about this error, try `rustc --explain E0525`.