don't process external_traits when collecting intra-doc links

This commit is contained in:
QuietMisdreavus 2019-03-06 10:16:41 -06:00
parent 1999a22881
commit e721f5e083

View file

@ -213,6 +213,7 @@ impl<'a, 'tcx, 'rcx> LinkCollector<'a, 'tcx, 'rcx> {
_ => Err(())
}
} else {
debug!("attempting to resolve item without parent module: {}", path_str);
Err(())
}
}
@ -434,6 +435,15 @@ impl<'a, 'tcx, 'rcx> DocFolder for LinkCollector<'a, 'tcx, 'rcx> {
self.fold_item_recur(item)
}
}
// FIXME: if we can resolve intra-doc links from other crates, we can use the stock
// `fold_crate`, but until then we should avoid scanning `krate.external_traits` since those
// will never resolve properly
fn fold_crate(&mut self, mut c: Crate) -> Crate {
c.module = c.module.take().and_then(|module| self.fold_item(module));
c
}
}
/// Resolves a string as a macro.