Skip to content

Commit 45673e2

Browse files
committed
rustdoc: Remove fake_def_ids RefCell
1 parent 3e826bb commit 45673e2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/librustdoc/core.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ crate struct DocContext<'tcx> {
6767
crate ct_substs: RefCell<FxHashMap<DefId, clean::Constant>>,
6868
/// Table synthetic type parameter for `impl Trait` in argument position -> bounds
6969
crate impl_trait_bounds: RefCell<FxHashMap<ImplTraitParam, Vec<clean::GenericBound>>>,
70-
crate fake_def_ids: RefCell<FxHashMap<CrateNum, DefIndex>>,
70+
crate fake_def_ids: FxHashMap<CrateNum, DefIndex>,
7171
/// Auto-trait or blanket impls processed so far, as `(self_ty, trait_def_id)`.
7272
// FIXME(eddyb) make this a `ty::TraitRef<'tcx>` set.
7373
crate generated_synthetics: RefCell<FxHashSet<(Ty<'tcx>, DefId)>>,
@@ -140,16 +140,14 @@ impl<'tcx> DocContext<'tcx> {
140140
/// [`RefCell`]: std::cell::RefCell
141141
/// [`Debug`]: std::fmt::Debug
142142
/// [`clean::Item`]: crate::clean::types::Item
143-
crate fn next_def_id(&self, crate_num: CrateNum) -> DefId {
144-
let mut fake_ids = self.fake_def_ids.borrow_mut();
145-
146-
let def_index = match fake_ids.entry(crate_num) {
143+
crate fn next_def_id(&mut self, crate_num: CrateNum) -> DefId {
144+
let def_index = match self.fake_def_ids.entry(crate_num) {
147145
Entry::Vacant(e) => {
148146
let num_def_idx = {
149147
let num_def_idx = if crate_num == LOCAL_CRATE {
150148
self.tcx.hir().definitions().def_path_table().num_def_ids()
151149
} else {
152-
self.enter_resolver(|r| r.cstore().num_def_ids(crate_num))
150+
self.resolver.borrow_mut().access(|r| r.cstore().num_def_ids(crate_num))
153151
};
154152

155153
DefIndex::from_usize(num_def_idx)

0 commit comments

Comments
 (0)