@@ -474,11 +474,12 @@ impl clean::GenericArgs {
474474
475475// Possible errors when computing href link source for a `DefId`
476476crate enum HrefError {
477- // `DefId` is in an unknown location. This seems to happen when building without dependencies
478- // but a trait from a dependency is still visible
479- UnknownLocation ,
480- // Unavailable because private
481- Unavailable ,
477+ /// This item is known to rustdoc, but from a crate that does not have documentation generated.
478+ ///
479+ /// This can only happen for non-local items.
480+ DocumentationNotBuilt ,
481+ /// This can only happen for non-local items when `--document-private-items` is not passed.
482+ Private ,
482483 // Not in external cache, href link should be in same page
483484 NotInExternalCache ,
484485}
@@ -491,7 +492,7 @@ crate fn href(did: DefId, cx: &Context<'_>) -> Result<(String, ItemType, Vec<Str
491492 }
492493
493494 if !did. is_local ( ) && !cache. access_levels . is_public ( did) && !cache. document_private {
494- return Err ( HrefError :: Unavailable ) ;
495+ return Err ( HrefError :: Private ) ;
495496 }
496497
497498 let ( fqp, shortty, mut url_parts) = match cache. paths . get ( & did) {
@@ -513,7 +514,7 @@ crate fn href(did: DefId, cx: &Context<'_>) -> Result<(String, ItemType, Vec<Str
513514 s
514515 }
515516 ExternalLocation :: Local => href_relative_parts ( module_fqp, relative_to) ,
516- ExternalLocation :: Unknown => return Err ( HrefError :: UnknownLocation ) ,
517+ ExternalLocation :: Unknown => return Err ( HrefError :: DocumentationNotBuilt ) ,
517518 } ,
518519 )
519520 } else {
0 commit comments