This is a known issue regarding how the function traits are inferred through Deref
. As a workaround, you need to explicitly get a mutable reference by doing a mutable reborrow:
let mut t = Foo;
(&mut *t)();
or by calling DerefMut::deref_mut
:
let mut t = Foo;
t.deref_mut()();