1
Fork 0

Use def_id_full() where easily possible

In general, it should be preferred over `Type::def_id()`. See each
method's docs for more.
This commit is contained in:
Noah Lev 2021-10-21 20:12:20 -07:00
parent bf0cc90050
commit 0853c33c3b
4 changed files with 9 additions and 7 deletions

View file

@ -206,7 +206,9 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
|| i.trait_
.as_ref()
.map_or(false, |t| self.cache.masked_crates.contains(&t.def_id().krate))
|| i.for_.def_id().map_or(false, |d| self.cache.masked_crates.contains(&d.krate))
|| i.for_
.def_id_full(self.cache)
.map_or(false, |d| self.cache.masked_crates.contains(&d.krate))
{
return None;
}
@ -454,7 +456,7 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
if let Some(generics) = i.trait_.as_ref().and_then(|t| t.generics()) {
for bound in generics {
if let Some(did) = bound.def_id() {
if let Some(did) = bound.def_id_full(self.cache) {
dids.insert(did);
}
}