@@ -159,12 +159,11 @@ pub fn load_attrs(cx: &DocContext, did: DefId) -> clean::Attributes {
159
159
/// These names are used later on by HTML rendering to generate things like
160
160
/// source links back to the original item.
161
161
pub fn record_extern_fqn ( cx : & DocContext , did : DefId , kind : clean:: TypeKind ) {
162
+ let mut crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
162
163
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) ;
165
165
}
166
166
167
- let crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
168
167
let relative = cx. tcx . def_path ( did) . data . into_iter ( ) . filter_map ( |elem| {
169
168
// extern blocks have an empty name
170
169
let s = elem. data . to_string ( ) ;
@@ -179,7 +178,12 @@ pub fn record_extern_fqn(cx: &DocContext, did: DefId, kind: clean::TypeKind) {
179
178
} else {
180
179
once ( crate_name) . chain ( relative) . collect ( )
181
180
} ;
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
+ }
183
187
}
184
188
185
189
pub fn build_external_trait ( cx : & DocContext , did : DefId ) -> clean:: Trait {
0 commit comments