diff options
| author | bors <bors@rust-lang.org> | 2024-10-20 05:58:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-20 05:58:20 +0000 |
| commit | bfab34af4c5bfbcc9168064857bbec826a60a0b9 (patch) | |
| tree | 883b133124fc761a57a7790b73e294c6c4b8e1ad | |
| parent | d68c32779627fcd72a928c9e89f65094dbcf7482 (diff) | |
| parent | 3e67fbda5e53da5b21ceb22727437351df579247 (diff) | |
| download | rust-bfab34af4c5bfbcc9168064857bbec826a60a0b9.tar.gz rust-bfab34af4c5bfbcc9168064857bbec826a60a0b9.zip | |
Auto merge of #131957 - GuillaumeGomez:rm-unused, r=notriddle
Remove unused `recoverable` argument in collect_intra_doc_links r? `@notriddle`
| -rw-r--r-- | src/librustdoc/passes/collect_intra_doc_links.rs | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index cbc6e351fac..2f0ea8d618c 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -1091,7 +1091,6 @@ impl LinkCollector<'_, '_> { // resolutions are cached, for other links we want to report an error every // time so they are not cached. matches!(ori_link.kind, LinkType::Reference | LinkType::Shortcut), - false, )?; if resolved.len() > 1 { @@ -1404,9 +1403,6 @@ impl LinkCollector<'_, '_> { // If errors are cached then they are only reported on first occurrence // which we want in some cases but not in others. cache_errors: bool, - // If this call is intended to be recoverable, then pass true to silence. - // This is only recoverable when path is failed to resolved. - recoverable: bool, ) -> Option<Vec<(Res, Option<UrlFragment>)>> { if let Some(res) = self.visited_links.get(&key) { if res.is_some() || cache_errors { @@ -1414,7 +1410,7 @@ impl LinkCollector<'_, '_> { } } - let mut candidates = self.resolve_with_disambiguator(&key, diag.clone(), recoverable); + let mut candidates = self.resolve_with_disambiguator(&key, diag.clone()); // FIXME: it would be nice to check that the feature gate was enabled in the original crate, not just ignore it altogether. // However I'm not sure how to check that across crates. @@ -1463,14 +1459,10 @@ impl LinkCollector<'_, '_> { } /// After parsing the disambiguator, resolve the main part of the link. - // FIXME(jynelson): wow this is just so much fn resolve_with_disambiguator( &mut self, key: &ResolutionInfo, diag: DiagnosticInfo<'_>, - // If this call is intended to be recoverable, then pass true to silence. - // This is only recoverable when path is failed to resolved. - recoverable: bool, ) -> Vec<(Res, Option<DefId>)> { let disambiguator = key.dis; let path_str = &key.path_str; @@ -1500,9 +1492,7 @@ impl LinkCollector<'_, '_> { } } } - if !recoverable { - resolution_failure(self, diag, path_str, disambiguator, smallvec![err]); - } + resolution_failure(self, diag, path_str, disambiguator, smallvec![err]); return vec![]; } } @@ -1539,15 +1529,13 @@ impl LinkCollector<'_, '_> { .fold(0, |acc, res| if let Ok(res) = res { acc + res.len() } else { acc }); if len == 0 { - if !recoverable { - resolution_failure( - self, - diag, - path_str, - disambiguator, - candidates.into_iter().filter_map(|res| res.err()).collect(), - ); - } + resolution_failure( + self, + diag, + path_str, + disambiguator, + candidates.into_iter().filter_map(|res| res.err()).collect(), + ); return vec![]; } else if len == 1 { candidates.into_iter().filter_map(|res| res.ok()).flatten().collect::<Vec<_>>() |
