@@ -366,7 +366,7 @@ crate struct Item {
366366 /// Information about this item that is specific to what kind of item it is.
367367 /// E.g., struct vs enum vs function.
368368 crate kind : Box < ItemKind > ,
369- crate def_id : ItemId ,
369+ crate item_id : ItemId ,
370370
371371 crate cfg : Option < Arc < Cfg > > ,
372372}
@@ -380,7 +380,7 @@ impl fmt::Debug for Item {
380380 let mut fmt = f. debug_struct ( "Item" ) ;
381381 fmt. field ( "name" , & self . name )
382382 . field ( "visibility" , & self . visibility )
383- . field ( "def_id " , & self . def_id ) ;
383+ . field ( "item_id " , & self . item_id ) ;
384384 // allow printing the full item if someone really wants to
385385 if alternate {
386386 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 {
408408
409409impl Item {
410410 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) )
412412 }
413413
414414 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) )
416416 }
417417
418418 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) )
420420 }
421421
422422 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 )
424424 }
425425
426426 crate fn span ( & self , tcx : TyCtxt < ' _ > ) -> Span {
@@ -432,14 +432,14 @@ impl Item {
432432 ItemKind :: ModuleItem ( Module { span, .. } ) => * span,
433433 ItemKind :: ImplItem ( Impl { kind : ImplKind :: Auto , .. } ) => Span :: dummy ( ) ,
434434 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 {
436436 rustc_span ( impl_id, tcx)
437437 } else {
438438 panic ! ( "blanket impl item has non-blanket ID" )
439439 }
440440 }
441441 _ => {
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)
443443 }
444444 }
445445 }
@@ -503,7 +503,7 @@ impl Item {
503503 cx. tcx . visibility ( def_id) . clean ( cx)
504504 } ;
505505
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 }
507507 }
508508
509509 /// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
@@ -517,7 +517,7 @@ impl Item {
517517
518518 cx. cache ( )
519519 . intra_doc_links
520- . get ( & self . def_id )
520+ . get ( & self . item_id )
521521 . map_or ( & [ ] [ ..] , |v| v. as_slice ( ) )
522522 . iter ( )
523523 . filter_map ( |ItemLink { link : s, link_text, did, ref fragment } | {
@@ -547,7 +547,7 @@ impl Item {
547547 crate fn link_names ( & self , cache : & Cache ) -> Vec < RenderedLink > {
548548 cache
549549 . intra_doc_links
550- . get ( & self . def_id )
550+ . get ( & self . item_id )
551551 . map_or ( & [ ] [ ..] , |v| v. as_slice ( ) )
552552 . iter ( )
553553 . map ( |ItemLink { link : s, link_text, .. } | RenderedLink {
@@ -559,7 +559,7 @@ impl Item {
559559 }
560560
561561 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 )
563563 }
564564 crate fn is_mod ( & self ) -> bool {
565565 self . type_ ( ) == ItemType :: Module
@@ -695,7 +695,7 @@ impl Item {
695695 }
696696 let header = match * self . kind {
697697 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 ( ) ;
699699 hir:: FnHeader {
700700 unsafety : if abi == Abi :: RustIntrinsic {
701701 intrinsic_operation_unsafety ( self . name . unwrap ( ) )
@@ -708,11 +708,11 @@ impl Item {
708708 }
709709 }
710710 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 ( ) ;
712712 build_fn_header ( def_id, tcx, tcx. asyncness ( def_id) )
713713 }
714714 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 )
716716 }
717717 _ => return None ,
718718 } ;
0 commit comments