@@ -159,12 +159,11 @@ pub fn load_attrs(cx: &DocContext, did: DefId) -> clean::Attributes {
159159/// These names are used later on by HTML rendering to generate things like
160160/// source links back to the original item.
161161pub fn record_extern_fqn ( cx : & DocContext , did : DefId , kind : clean:: TypeKind ) {
162+ let mut crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
162163 if did. is_local ( ) {
163- debug ! ( "record_extern_fqn(did={:?}, kind+{:?}): def_id is local, aborting" , did, kind) ;
164- return ;
164+ crate_name = cx. crate_name . clone ( ) . unwrap_or ( crate_name) ;
165165 }
166166
167- let crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
168167 let relative = cx. tcx . def_path ( did) . data . into_iter ( ) . filter_map ( |elem| {
169168 // extern blocks have an empty name
170169 let s = elem. data . to_string ( ) ;
@@ -179,7 +178,12 @@ pub fn record_extern_fqn(cx: &DocContext, did: DefId, kind: clean::TypeKind) {
179178 } else {
180179 once ( crate_name) . chain ( relative) . collect ( )
181180 } ;
182- cx. renderinfo . borrow_mut ( ) . external_paths . insert ( did, ( fqn, kind) ) ;
181+
182+ if did. is_local ( ) {
183+ cx. renderinfo . borrow_mut ( ) . exact_paths . insert ( did, fqn) ;
184+ } else {
185+ cx. renderinfo . borrow_mut ( ) . external_paths . insert ( did, ( fqn, kind) ) ;
186+ }
183187}
184188
185189pub fn build_external_trait ( cx : & DocContext , did : DefId ) -> clean:: Trait {
0 commit comments