@@ -240,7 +240,7 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
240
240
use MaybeInlined :: NotInlined ;
241
241
242
242
let def_id = cx. tcx . hir ( ) . local_def_id ( self . hir_id ) . to_def_id ( ) ;
243
- let name = cx. tcx . item_name ( def_id ) . clean ( cx ) ;
243
+ let name = cx. tcx . hir ( ) . name ( self . hir_id ) ;
244
244
let maybe_inlined = match self . kind {
245
245
ItemKind :: ExternCrate ( renamed) => clean_extern_crate ( self , renamed, cx) ,
246
246
ItemKind :: Use ( path, kind) => clean_import ( self , path, kind, cx) ,
@@ -318,7 +318,7 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
318
318
let build_item = |kind| Item {
319
319
def_id,
320
320
kind,
321
- name : Some ( name) ,
321
+ name : Some ( name. to_string ( ) ) ,
322
322
source : cx. tcx . def_span ( def_id) . clean ( cx) ,
323
323
attrs : self . attrs . clean ( cx) , // TODO: should this use tcx.attrs instead?
324
324
visibility : self . vis . clean ( cx) , // TODO: should this use tcx.visibility instead?
@@ -2193,8 +2193,7 @@ fn clean_import(
2193
2193
}
2194
2194
Import :: new_glob ( resolve_use_source ( cx, path) , true )
2195
2195
} else {
2196
- let def_id = cx. tcx . hir ( ) . local_def_id ( item. hir_id ) . to_def_id ( ) ;
2197
- let name = cx. tcx . item_name ( def_id) ;
2196
+ let name = cx. tcx . hir ( ) . name ( item. hir_id ) ;
2198
2197
if !please_inline {
2199
2198
if let Res :: Def ( DefKind :: Mod , did) = path. res {
2200
2199
if !did. is_local ( ) && did. index == CRATE_DEF_INDEX {
0 commit comments