-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Description
There are the following blanket implementations of the Fn traits on reference types (abbreviated to omit the argument type):
impl Fn for &F where F: Fnimpl FnMut for &F where F: Fnimpl FnOnce for &F where F: Fnimpl FnMut for &mut F where F: FnMutimpl FnOnce for &mut F where F: FnMut
The following blanket implementation is possible to implement, but is missing from the standard library:
impl Fn for &mut F where F: Fn
As far as I can tell, this blanket impl was overlooked in the initial implementation.
This leads to a weird situation where &mut F implements fewer of the Fn traits than &F. This is somewhat strange.
I'm not sure if this needs to be fixed though, since I can't come up with a realistic use case that would run into this.
I am unsure if this is a breaking change or not, as this is a new implementation of a fundamental trait on a fundamental type. I am unable to find code that compiles in stable rust that would break from this change though.
Meta
Affects stable rust version 1.90.0.