Skip to content

Commit 5856e40

Browse files
Remove Crate::primitives field
1 parent 4e0d0d7 commit 5856e40

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/librustdoc/clean/types.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ impl From<DefId> for ItemId {
115115
#[derive(Clone, Debug)]
116116
pub(crate) struct Crate {
117117
pub(crate) module: Item,
118-
pub(crate) primitives: ThinVec<(DefId, PrimitiveType)>,
119118
/// Only here so that they can be filtered through the rustdoc passes.
120119
pub(crate) external_traits: Rc<RefCell<FxHashMap<DefId, Trait>>>,
121120
}
@@ -2572,7 +2571,7 @@ mod size_asserts {
25722571
use super::*;
25732572
use rustc_data_structures::static_assert_size;
25742573
// tidy-alphabetical-start
2575-
static_assert_size!(Crate, 72); // frequently moved by-value
2574+
static_assert_size!(Crate, 64); // frequently moved by-value
25762575
static_assert_size!(DocFragment, 32);
25772576
static_assert_size!(GenericArg, 32);
25782577
static_assert_size!(GenericArgs, 32);

src/librustdoc/clean/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub(crate) fn krate(cx: &mut DocContext<'_>) -> Crate {
7373
}));
7474
}
7575

76-
Crate { module, primitives, external_traits: cx.external_traits.clone() }
76+
Crate { module, external_traits: cx.external_traits.clone() }
7777
}
7878

7979
pub(crate) fn substs_to_args<'tcx>(

src/librustdoc/passes/collect_trait_impls.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::formats::cache::Cache;
88
use crate::visit::DocVisitor;
99

1010
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
11-
use rustc_hir::def_id::DefId;
11+
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
1212
use rustc_middle::ty::{self, DefIdTree};
1313
use rustc_span::symbol::sym;
1414

@@ -25,7 +25,9 @@ pub(crate) fn collect_trait_impls(mut krate: Crate, cx: &mut DocContext<'_>) ->
2525
synth.impls
2626
});
2727

28-
let prims: FxHashSet<PrimitiveType> = krate.primitives.iter().map(|p| p.1).collect();
28+
let local_crate = ExternalCrate { crate_num: LOCAL_CRATE };
29+
let prims: FxHashSet<PrimitiveType> =
30+
local_crate.primitives(cx.tcx).iter().map(|p| p.1).collect();
2931

3032
let crate_items = {
3133
let mut coll = ItemCollector::new();

0 commit comments

Comments
 (0)