resolve: Remove visibility_untracked

This commit is contained in:
Vadim Petrochenkov 2023-02-22 01:11:16 +04:00
parent d610b0c514
commit 17127f3e78
2 changed files with 4 additions and 11 deletions

View file

@ -526,10 +526,6 @@ impl CStore {
self.get_crate_data(def.krate).get_ctor(def.index)
}
pub fn visibility_untracked(&self, def: DefId) -> Visibility<DefId> {
self.get_crate_data(def.krate).get_visibility(def.index)
}
pub fn module_children_untracked<'a>(
&'a self,
def_id: DefId,

View file

@ -1007,18 +1007,15 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
// Record some extra data for better diagnostics.
match res {
Res::Def(DefKind::Struct, def_id) => {
let cstore = self.r.cstore();
if let Some((ctor_kind, ctor_def_id)) = cstore.ctor_untracked(def_id) {
let ctor = self.r.cstore().ctor_untracked(def_id);
if let Some((ctor_kind, ctor_def_id)) = ctor {
let ctor_res = Res::Def(DefKind::Ctor(CtorOf::Struct, ctor_kind), ctor_def_id);
let ctor_vis = cstore.visibility_untracked(ctor_def_id);
let ctor_vis = self.r.tcx.visibility(ctor_def_id);
let field_visibilities =
cstore.struct_field_visibilities_untracked(def_id).collect();
drop(cstore);
self.r.cstore().struct_field_visibilities_untracked(def_id).collect();
self.r
.struct_constructors
.insert(def_id, (ctor_res, ctor_vis, field_visibilities));
} else {
drop(cstore);
}
self.insert_field_names_extern(def_id)
}