Hello.
I am trying to store a Rust function inside my Built-In Function type. However, it complains that the lifetime bound for the object type cannot be deduced from context. (Here: &dyn Fn(HashMap<String, String>, context::Context) -> Type)
error[E0277]: the trait bound `dyn std::ops::Fn(std::collections::HashMap<std::string::String, std::string::String>, version::context::Context) -> version::types::Type: std::clone::Clone` is not satisfied
--> src/version/types.rs:37:65
|
37 | BuiltInFunctionType(String, HashMap<i32, (String, String)>, Box<dyn Fn(HashMap<String, String>, context::Context) -> Type>)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `dyn std::ops::Fn(std::collections::HashMap<std::string::String, std::string::String>, version::context::Context) -> version::types::Type`
|
= note: required because of the requirements on the impl of `std::clone::Clone` for `std::boxed::Box<dyn std::ops::Fn(std::collections::HashMap<std::string::String, std::string::String>, version::context::Context) -> version::types::Type>`
= note: required by `std::clone::Clone::clone`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)