Skip to content

Commit

Permalink
Rollup merge of #75745 - jyn514:refactor-resolve, r=Manishearth
Browse files Browse the repository at this point in the history
Remove duplication in `fold_item`

r? @Manishearth
  • Loading branch information
Dylan-DPC authored Aug 22, 2020
2 parents ec62980 + f5d7848 commit 17d60e4
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
}

match disambiguator.map(Disambiguator::ns) {
Some(ns @ ValueNS) => {
Some(ns @ (ValueNS | TypeNS)) => {
match self.resolve(
path_str,
disambiguator,
Expand All @@ -660,28 +660,6 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
}
}
}
Some(ns @ TypeNS) => {
match self.resolve(
path_str,
disambiguator,
ns,
&current_item,
base_node,
&extra_fragment,
Some(&item),
) {
Ok(res) => res,
Err(ErrorKind::ResolutionFailure) => {
resolution_failure(cx, &item, path_str, &dox, link_range);
// This could just be a normal link.
continue;
}
Err(ErrorKind::AnchorFailure(msg)) => {
anchor_failure(cx, &item, &ori_link, &dox, link_range, msg);
continue;
}
}
}
None => {
// Try everything!
let mut candidates = PerNS {
Expand Down

0 comments on commit 17d60e4

Please sign in to comment.