about summary refs log tree commit diff
path: root/src/librustdoc/clean
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-16 06:44:10 +0000
committerbors <bors@rust-lang.org>2021-07-16 06:44:10 +0000
commita6470c7fa8a511cfbcf9e9d3e1ab6779ac661edb (patch)
tree0e336fb7e40ac0eb14ff61b2962b559408d4b4c4 /src/librustdoc/clean
parent057050a95bdfc5849a893208c53c7b2a081c6808 (diff)
parent450c28a45e387fb54bbc84cf88c3556f93bcf1b8 (diff)
downloadrust-a6470c7fa8a511cfbcf9e9d3e1ab6779ac661edb.tar.gz
rust-a6470c7fa8a511cfbcf9e9d3e1ab6779ac661edb.zip
Auto merge of #86662 - mockersf:fix-86620-link-unknown-location, r=jyn514
fix dead link for method in trait of blanket impl from third party crate

fix #86620

* changes `href` method to raise the actual error it had instead of an `Option`
* set the href link correctly in case of an error

I did not manage to make a small reproducer, I think it happens in a situation where
* crate A expose a trait with a blanket impl
* crate B use the trait from crate A
* crate C use types from crate B
* building docs for crate C without dependencies

r? `@jyn514`
Diffstat (limited to 'src/librustdoc/clean')
-rw-r--r--src/librustdoc/clean/types.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index e716e09b8b3..859746b6a2d 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -459,7 +459,7 @@ impl Item {
             .filter_map(|ItemLink { link: s, link_text, did, ref fragment }| {
                 match did {
                     Some(did) => {
-                        if let Some((mut href, ..)) = href(did.clone(), cx) {
+                        if let Ok((mut href, ..)) = href(did.clone(), cx) {
                             if let Some(ref fragment) = *fragment {
                                 href.push('#');
                                 href.push_str(fragment);