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.

Leave a Comment