Skip to content

Commit 16679a6

Browse files
zredbGuillaumeGomez
authored andcommitted
remove the definition of def_id_no_primitives and change; a missing use was modified; narrow the Cache accessibility of BadImplStripper;
1 parent be9d633 commit 16679a6

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/librustdoc/clean/types.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,23 +1566,11 @@ impl Type {
15661566

15671567
/// Use this method to get the [DefId] of a [clean] AST node, including [PrimitiveType]s.
15681568
///
1569-
/// See [`Self::def_id_no_primitives`] for more.
1570-
///
15711569
/// [clean]: crate::clean
1570+
///
15721571
crate fn def_id(&self, cache: &Cache) -> Option<DefId> {
15731572
self.inner_def_id(Some(cache))
15741573
}
1575-
1576-
/// Use this method to get the [`DefId`] of a [`clean`] AST node.
1577-
/// This will return [`None`] when called on a primitive [`clean::Type`].
1578-
/// Use [`Self::def_id`] if you want to include primitives.
1579-
///
1580-
/// [`clean`]: crate::clean
1581-
/// [`clean::Type`]: crate::clean::Type
1582-
// FIXME: get rid of this function and always use `def_id`
1583-
crate fn def_id_no_primitives(&self) -> Option<DefId> {
1584-
self.inner_def_id(None)
1585-
}
15861574
}
15871575

15881576
/// A primitive (aka, builtin) type.

src/librustdoc/passes/collect_trait_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl DocVisitor for ItemCollector {
208208
struct BadImplStripper<'a> {
209209
prims: FxHashSet<PrimitiveType>,
210210
items: FxHashSet<ItemId>,
211-
crate cache: &'a Cache,
211+
cache: &'a Cache,
212212
}
213213

214214
impl<'a> BadImplStripper<'a> {

src/librustdoc/passes/stripper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'a> DocFolder for ImplStripper<'a> {
144144
}
145145
if let Some(generics) = imp.trait_.as_ref().and_then(|t| t.generics()) {
146146
for typaram in generics {
147-
if let Some(did) = typaram.def_id_no_primitives() {
147+
if let Some(did) = typaram.def_id(self.cache) {
148148
if did.is_local() && !self.retained.contains(&did.into()) {
149149
debug!(
150150
"ImplStripper: stripped item in trait's generics; removing impl"

0 commit comments

Comments
 (0)