[Solved] "one type is more general than the other", but they are exactly the same

Writing agent_factory as _, I get the same error as before.
What I did was: let exp = CoverageExperiment::new(agent_factory as _, domain_factory, episode_length);

One thing I find strange is that I have had no such problem with domain_factory, which is Box<dyn Fn() -> D>. (created like this: let domain_factory = Box::new(Env::default);)
I will write a minimal test case when I have time.