1
Fork 0

Rollup merge of #109704 - petrochenkov:effvisclean, r=jackh726

resolve: Minor improvements to effective visibilities

See individual commits.
This commit is contained in:
Michael Goulet 2023-03-30 12:42:19 -07:00 committed by GitHub
commit fbe738345c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 65 deletions

View file

@ -6,7 +6,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_macros::HashStable;
use rustc_query_system::ich::StableHashingContext;
use rustc_span::def_id::LocalDefId;
use rustc_span::def_id::{LocalDefId, CRATE_DEF_ID};
use std::hash::Hash;
/// Represents the levels of effective visibility an item can have.
@ -107,6 +107,10 @@ impl EffectiveVisibilities {
})
}
pub fn update_root(&mut self) {
self.map.insert(CRATE_DEF_ID, EffectiveVisibility::from_vis(Visibility::Public));
}
// FIXME: Share code with `fn update`.
pub fn update_eff_vis(
&mut self,