/// Use this method to get the [DefId] of a [clean] AST node, including [PrimitiveType]s.
///
- /// See [`Self::def_id_no_primitives`] for more.
- ///
/// [clean]: crate::clean
+ ///
crate fn def_id(&self, cache: &Cache) -> Option<DefId> {
self.inner_def_id(Some(cache))
}
-
- /// Use this method to get the [`DefId`] of a [`clean`] AST node.
- /// This will return [`None`] when called on a primitive [`clean::Type`].
- /// Use [`Self::def_id`] if you want to include primitives.
- ///
- /// [`clean`]: crate::clean
- /// [`clean::Type`]: crate::clean::Type
- // FIXME: get rid of this function and always use `def_id`
- crate fn def_id_no_primitives(&self) -> Option<DefId> {
- self.inner_def_id(None)
- }
}
/// A primitive (aka, builtin) type.
struct BadImplStripper<'a> {
prims: FxHashSet<PrimitiveType>,
items: FxHashSet<ItemId>,
- crate cache: &'a Cache,
+ cache: &'a Cache,
}
impl<'a> BadImplStripper<'a> {
}
if let Some(generics) = imp.trait_.as_ref().and_then(|t| t.generics()) {
for typaram in generics {
- if let Some(did) = typaram.def_id_no_primitives() {
+ if let Some(did) = typaram.def_id(self.cache) {
if did.is_local() && !self.retained.contains(&did.into()) {
debug!(
"ImplStripper: stripped item in trait's generics; removing impl"