mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
Rollup merge of #75745 - jyn514:refactor-resolve, r=Manishearth
Remove duplication in `fold_item` r? @Manishearth
This commit is contained in:
commit
17d60e44b0
@ -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,
|
||||
@ -660,28 +660,6 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(ns @ TypeNS) => {
|
||||
match self.resolve(
|
||||
path_str,
|
||||
disambiguator,
|
||||
ns,
|
||||
¤t_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 {
|
||||
|
Loading…
Reference in New Issue
Block a user