You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results in an error about conflicting implementations. This is because there might exist a type that implements both FnMut() and FnMut(usize) -> usize. In reality such a type will of course never exist.
Actually, I'm pretty sure that it is easily possible for a type to implement both, since the Fn traits can be implememted for a type like any other traits, ie. you can do struct A; impl Fn() for A { ... }.
Once implementing Fn-traits is made stable, what @TimNN said is correct. Such case could also occur once we get something like default arguments, resulting in one value having multiple ways to call it – and thus multiple FnOnce implementations.
Currently you can't write something like this:
This results in an error about conflicting implementations. This is because there might exist a type that implements both
FnMut()
andFnMut(usize) -> usize
. In reality such a type will of course never exist.Potential dupe of #19032 but I'm not sure
The text was updated successfully, but these errors were encountered: