-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Sort of an awkward way to word this, but it'll make a bit more sense with an explanation.
Right now, there are implementations for &T + T, T + &T, and T += &T for integer types. There should be some nice list of traits where there should be suggestions to add implementations for references as well.
Just off the top of my head:
Add, etc. should haveAdd<&U> for TandAdd<U> for &TifAdd<U> for Tis available.AddAssign, etc. should haveAddAssign<&U> for TifAddAssign<U> for Tis available.Sum, etc. should haveSum for &TifSum for Tis available.
There may be a way to detect a list of traits where an impl for T should suggest an impl for &T, &mut T, and Box<T> as well, like Hasher and Debug. I'm not sure how we could suggest which traits work for this, but I figured I'd add it to the discussion.
These "convenience" impls are nice to have and there are a lot of cases where these are added to the standard library when they are forgotten. It'd be nice if we could suggest them via clippy.