@@ -366,7 +366,7 @@ crate struct Item {
366
366
/// Information about this item that is specific to what kind of item it is.
367
367
/// E.g., struct vs enum vs function.
368
368
crate kind : Box < ItemKind > ,
369
- crate def_id : ItemId ,
369
+ crate item_id : ItemId ,
370
370
371
371
crate cfg : Option < Arc < Cfg > > ,
372
372
}
@@ -380,7 +380,7 @@ impl fmt::Debug for Item {
380
380
let mut fmt = f. debug_struct ( "Item" ) ;
381
381
fmt. field ( "name" , & self . name )
382
382
. field ( "visibility" , & self . visibility )
383
- . field ( "def_id " , & self . def_id ) ;
383
+ . field ( "item_id " , & self . item_id ) ;
384
384
// allow printing the full item if someone really wants to
385
385
if alternate {
386
386
fmt. field ( "attrs" , & self . attrs ) . field ( "kind" , & self . kind ) . field ( "cfg" , & self . cfg ) ;
@@ -408,19 +408,19 @@ crate fn rustc_span(def_id: DefId, tcx: TyCtxt<'_>) -> Span {
408
408
409
409
impl Item {
410
410
crate fn stability < ' tcx > ( & self , tcx : TyCtxt < ' tcx > ) -> Option < Stability > {
411
- self . def_id . as_def_id ( ) . and_then ( |did| tcx. lookup_stability ( did) )
411
+ self . item_id . as_def_id ( ) . and_then ( |did| tcx. lookup_stability ( did) )
412
412
}
413
413
414
414
crate fn const_stability < ' tcx > ( & self , tcx : TyCtxt < ' tcx > ) -> Option < ConstStability > {
415
- self . def_id . as_def_id ( ) . and_then ( |did| tcx. lookup_const_stability ( did) )
415
+ self . item_id . as_def_id ( ) . and_then ( |did| tcx. lookup_const_stability ( did) )
416
416
}
417
417
418
418
crate fn deprecation ( & self , tcx : TyCtxt < ' _ > ) -> Option < Deprecation > {
419
- self . def_id . as_def_id ( ) . and_then ( |did| tcx. lookup_deprecation ( did) )
419
+ self . item_id . as_def_id ( ) . and_then ( |did| tcx. lookup_deprecation ( did) )
420
420
}
421
421
422
422
crate fn inner_docs ( & self , tcx : TyCtxt < ' _ > ) -> bool {
423
- self . def_id . as_def_id ( ) . map ( |did| tcx. get_attrs ( did) . inner_docs ( ) ) . unwrap_or ( false )
423
+ self . item_id . as_def_id ( ) . map ( |did| tcx. get_attrs ( did) . inner_docs ( ) ) . unwrap_or ( false )
424
424
}
425
425
426
426
crate fn span ( & self , tcx : TyCtxt < ' _ > ) -> Span {
@@ -432,14 +432,14 @@ impl Item {
432
432
ItemKind :: ModuleItem ( Module { span, .. } ) => * span,
433
433
ItemKind :: ImplItem ( Impl { kind : ImplKind :: Auto , .. } ) => Span :: dummy ( ) ,
434
434
ItemKind :: ImplItem ( Impl { kind : ImplKind :: Blanket ( _) , .. } ) => {
435
- if let ItemId :: Blanket { impl_id, .. } = self . def_id {
435
+ if let ItemId :: Blanket { impl_id, .. } = self . item_id {
436
436
rustc_span ( impl_id, tcx)
437
437
} else {
438
438
panic ! ( "blanket impl item has non-blanket ID" )
439
439
}
440
440
}
441
441
_ => {
442
- self . def_id . as_def_id ( ) . map ( |did| rustc_span ( did, tcx) ) . unwrap_or_else ( Span :: dummy)
442
+ self . item_id . as_def_id ( ) . map ( |did| rustc_span ( did, tcx) ) . unwrap_or_else ( Span :: dummy)
443
443
}
444
444
}
445
445
}
@@ -503,7 +503,7 @@ impl Item {
503
503
cx. tcx . visibility ( def_id) . clean ( cx)
504
504
} ;
505
505
506
- Item { def_id : def_id. into ( ) , kind : box kind, name, attrs, visibility, cfg }
506
+ Item { item_id : def_id. into ( ) , kind : box kind, name, attrs, visibility, cfg }
507
507
}
508
508
509
509
/// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
@@ -517,7 +517,7 @@ impl Item {
517
517
518
518
cx. cache ( )
519
519
. intra_doc_links
520
- . get ( & self . def_id )
520
+ . get ( & self . item_id )
521
521
. map_or ( & [ ] [ ..] , |v| v. as_slice ( ) )
522
522
. iter ( )
523
523
. filter_map ( |ItemLink { link : s, link_text, did, ref fragment } | {
@@ -547,7 +547,7 @@ impl Item {
547
547
crate fn link_names ( & self , cache : & Cache ) -> Vec < RenderedLink > {
548
548
cache
549
549
. intra_doc_links
550
- . get ( & self . def_id )
550
+ . get ( & self . item_id )
551
551
. map_or ( & [ ] [ ..] , |v| v. as_slice ( ) )
552
552
. iter ( )
553
553
. map ( |ItemLink { link : s, link_text, .. } | RenderedLink {
@@ -559,7 +559,7 @@ impl Item {
559
559
}
560
560
561
561
crate fn is_crate ( & self ) -> bool {
562
- self . is_mod ( ) && self . def_id . as_def_id ( ) . map_or ( false , |did| did. index == CRATE_DEF_INDEX )
562
+ self . is_mod ( ) && self . item_id . as_def_id ( ) . map_or ( false , |did| did. index == CRATE_DEF_INDEX )
563
563
}
564
564
crate fn is_mod ( & self ) -> bool {
565
565
self . type_ ( ) == ItemType :: Module
@@ -695,7 +695,7 @@ impl Item {
695
695
}
696
696
let header = match * self . kind {
697
697
ItemKind :: ForeignFunctionItem ( _) => {
698
- let abi = tcx. fn_sig ( self . def_id . as_def_id ( ) . unwrap ( ) ) . abi ( ) ;
698
+ let abi = tcx. fn_sig ( self . item_id . as_def_id ( ) . unwrap ( ) ) . abi ( ) ;
699
699
hir:: FnHeader {
700
700
unsafety : if abi == Abi :: RustIntrinsic {
701
701
intrinsic_operation_unsafety ( self . name . unwrap ( ) )
@@ -708,11 +708,11 @@ impl Item {
708
708
}
709
709
}
710
710
ItemKind :: FunctionItem ( _) | ItemKind :: MethodItem ( _, _) => {
711
- let def_id = self . def_id . as_def_id ( ) . unwrap ( ) ;
711
+ let def_id = self . item_id . as_def_id ( ) . unwrap ( ) ;
712
712
build_fn_header ( def_id, tcx, tcx. asyncness ( def_id) )
713
713
}
714
714
ItemKind :: TyMethodItem ( _) => {
715
- build_fn_header ( self . def_id . as_def_id ( ) . unwrap ( ) , tcx, hir:: IsAsync :: NotAsync )
715
+ build_fn_header ( self . item_id . as_def_id ( ) . unwrap ( ) , tcx, hir:: IsAsync :: NotAsync )
716
716
}
717
717
_ => return None ,
718
718
} ;
0 commit comments