@@ -474,11 +474,12 @@ impl clean::GenericArgs {
474
474
475
475
// Possible errors when computing href link source for a `DefId`
476
476
crate 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 ,
482
483
// Not in external cache, href link should be in same page
483
484
NotInExternalCache ,
484
485
}
@@ -491,7 +492,7 @@ crate fn href(did: DefId, cx: &Context<'_>) -> Result<(String, ItemType, Vec<Str
491
492
}
492
493
493
494
if !did. is_local ( ) && !cache. access_levels . is_public ( did) && !cache. document_private {
494
- return Err ( HrefError :: Unavailable ) ;
495
+ return Err ( HrefError :: Private ) ;
495
496
}
496
497
497
498
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
513
514
s
514
515
}
515
516
ExternalLocation :: Local => href_relative_parts ( module_fqp, relative_to) ,
516
- ExternalLocation :: Unknown => return Err ( HrefError :: UnknownLocation ) ,
517
+ ExternalLocation :: Unknown => return Err ( HrefError :: DocumentationNotBuilt ) ,
517
518
} ,
518
519
)
519
520
} else {
0 commit comments