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