about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustdoc/html/render/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index e6a10c47497..a7016075407 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -867,10 +867,10 @@ fn render_assoc_item(
                     ItemType::TyMethod
                 };
 
-                match href(did.expect_def_id(), cx) {
-                    Ok(p) => Some(format!("{}#{}.{}", p.0, ty, name)),
-                    Err(HrefError::DocumentationNotBuilt) => None,
-                    Err(_) => Some(format!("#{}.{}", ty, name)),
+                match (href(did.expect_def_id(), cx), ty) {
+                    (Ok(p), ty) => Some(format!("{}#{}.{}", p.0, ty, name)),
+                    (Err(HrefError::DocumentationNotBuilt), ItemType::TyMethod) => None,
+                    (Err(_), ty) => Some(format!("#{}.{}", ty, name)),
                 }
             }
         };