#[unstable(…)] attributes on trait
impls are no-op and all trait
impls are "insta-stable". However, it often causes type inference regressions.
Here, I propose a way to solve the long-standing issue above in a generic manner, without affecting the semantics of the language.
Consider cost of each trait
impl as stabilization version or 0 if no stabilization attribute present. Then define cost of a solution (of a trait resolution) as the maximum of the costs of the used
impl s. We want to find a solution with minimal cost solution. If there are multiple solutions with the same minimum cost, then it is an error.
Feedback welcome. Although I'm presenting there in the RFC format, this is just an idea yet and no way I can complete this as a RFC at this moment. Probably I'm missing something big so please pointing out such issues me.