I do not know what I’m reporting is a bug , issue or what ever. I need your help to figure out.
First question: I want to understand why a function defined by fn key is considered as all Fn*?
This is proved by coding, see my code in https://github.com/efaysal/Rustf2F/
I defined, generically, 3 kind of call-execution methods, one using only Fn closure ( having the marker Fn ), second using FnMut closure and the third using only FnOnce closure. I used the same name in the tree call-execution methods, “execution”. The current Rust compiler passed all of them without a single warning sign.
So which one the current Rust compiler will infer from these 3 calls at run time?
When my code has all the closures, Fn*, and when “execute” used a self-defined function as argument, Rust system at run time used:
-) The execution function defined by FnOnce, ( I expected actually the one defined by Fn.)
I kept only Fn and FnMut in the code ( I removed any thing related to FnOnce ) , when “execute” used a self-defined function as argument, Rust system at run time used in this case:
-) The execution function defined by Fn.
Any interpretation of this behaviour?
More details about my questions are in http://efaysal.github.io/Rust/RustF2f.html