External Publication
Visit Post

Named impl with Implementation Selection Variant

Rust Internals [Unofficial] June 13, 2026
Source

viruscamp:

  • […] it breaks bin B

No, it doesn't because A::fn1(); in B won't try to resolve to A's implementation unless B explicitly imports T1.


Edit: The case that would break it here (or potentially silently change behaviour!) is if A added an associated function fn1 on A directly. This is usually considered acceptable in that the unqualified call in B is considered fragile.

It's better practice to qualify it as ::<A as T>::fn1() there for such static calls. That's the reason why I think of "extension traits" that are intended to be called into statically without qualification as a bit sketchy sometimes.

Discussion in the ATmosphere

Loading comments...