Merge pull request #21725 from Veykril/push-skvpqzkooolm

fix: Fix wrong confiditon in `Visibility::min`
This commit is contained in:
Lukas Wirth 2026-02-28 17:09:40 +00:00 committed by GitHub
commit d5d00a364a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -234,7 +234,7 @@ impl Visibility {
if mod_.krate(db) == krate { Some(Visibility::Module(mod_, exp)) } else { None }
}
(Visibility::Module(mod_a, expl_a), Visibility::Module(mod_b, expl_b)) => {
if mod_a.krate(db) != mod_b.krate(db) {
if mod_a == mod_b {
// Most module visibilities are `pub(self)`, and assuming no errors
// this will be the common and thus fast path.
return Some(Visibility::Module(