Skip to content

Commit d468a81

Browse files
committedAug 20, 2020
Remove duplication in fold_item
1 parent 9900178 commit d468a81

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed
 

‎src/librustdoc/passes/collect_intra_doc_links.rs

+1-23
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
636636
}
637637

638638
match disambiguator.map(Disambiguator::ns) {
639-
Some(ns @ ValueNS) => {
639+
Some(ns @ ValueNS | ns @ TypeNS) => {
640640
match self.resolve(
641641
path_str,
642642
disambiguator,
@@ -660,28 +660,6 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
660660
}
661661
}
662662
}
663-
Some(ns @ TypeNS) => {
664-
match self.resolve(
665-
path_str,
666-
disambiguator,
667-
ns,
668-
&current_item,
669-
base_node,
670-
&extra_fragment,
671-
Some(&item),
672-
) {
673-
Ok(res) => res,
674-
Err(ErrorKind::ResolutionFailure) => {
675-
resolution_failure(cx, &item, path_str, &dox, link_range);
676-
// This could just be a normal link.
677-
continue;
678-
}
679-
Err(ErrorKind::AnchorFailure(msg)) => {
680-
anchor_failure(cx, &item, &ori_link, &dox, link_range, msg);
681-
continue;
682-
}
683-
}
684-
}
685663
None => {
686664
// Try everything!
687665
let mut candidates = PerNS {

0 commit comments

Comments
 (0)
Please sign in to comment.