You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@kpreid
IMO, using super, particularly across files, is fragile and best kept to a minimum, because it means that module-moving refactors can have surprising effects. I’ll change it anyway, but I am noting that I disagree with this policy.
@cwfitzgerald
Yeah that makes sense - I don't really have much of a preference either way, just following existing convention. Might be worth an issue about changing it. While hal backends have historically been a single mod + submodules, as we split things up more, we might see deeper splits.
Default private visibility is to this module (and children). pub(crate) limits visibilty to this crate. pub(in path) visibility is explicit about its purpose. pub(super) visibility is an oddball which limits visibility to whichever module happens to be this module’s parent. This is undesirable action-at-a-distance which can lead to, after refactoring, items being visible where they aren’t intended to be. I don’t think that this is a very serious problem, but I think that a policy of using pub(super)instead ofpub(in path) is an unwise policy.
The text was updated successfully, but these errors were encountered:
Copied from review discussion:
Default private visibility is to this module (and children).
pub(crate)
limits visibilty to this crate.pub(in path)
visibility is explicit about its purpose.pub(super)
visibility is an oddball which limits visibility to whichever module happens to be this module’s parent. This is undesirable action-at-a-distance which can lead to, after refactoring, items being visible where they aren’t intended to be. I don’t think that this is a very serious problem, but I think that a policy of usingpub(super)
instead ofpub(in path)
is an unwise policy.The text was updated successfully, but these errors were encountered: