rust/tests/ui/mismatched_types/issue-118510.stderr

27 lines
879 B
Plaintext

error[E0631]: type mismatch in function arguments
--> $DIR/issue-118510.rs:8:9
|
LL | Ident(&'a mut S),
| ----- found signature defined here
...
LL | map(Sexpr::Ident);
| --- ^^^^^^^^^^^^ expected due to this
| |
| required by a bound introduced by this call
|
= note: expected function signature `for<'a> fn(&'a _) -> _`
found function signature `fn(&mut _) -> _`
note: required by a bound in `map`
--> $DIR/issue-118510.rs:5:19
|
LL | fn map<Foo, T, F: FnOnce(&Foo) -> T>(f: F) {}
| ^^^^^^^^^^^^^^^^^ required by this bound in `map`
help: consider wrapping the function in a closure
|
LL | map(|arg0| Sexpr::Ident(&mut *arg0));
| ++++++ ++++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0631`.