When should I not implement a trait for references to implementors of that trait?

when shouldn't I implement this? Asked another way, why doesn't the compiler automatically implement this for me? Since it currently doesn't, I assume there must be cases where having this implementation would be disadvantageous.

As an example, the Default trait immediately came to mind.

pub trait Default {
    fn default() -> Self;
}

I could implement it for T, but there is no way to automatically implement it for &T.


The particular trait you are writing here only takes self by reference, and that is the only reason it is possible to write the additional implementation you did.

For this reason, taking the parameter to runner() by value is probably undesirable; you should instead be taking it by reference. This guideline can apply generally: if it is possible to implement the trait for a reference then rather than wondering “should I implement it?” you should wonder “why would I implement it?” for the only cases where you would use it should probably be altered to take the object by reference in the first place.