@@ -50,7 +50,7 @@ impl<'hir> Entry<'hir> {
5050 fn fn_decl ( & self ) -> Option < & ' hir FnDecl > {
5151 match self . node {
5252 Node :: Item ( ref item) => {
53- match item. node {
53+ match item. kind {
5454 ItemKind :: Fn ( ref fn_decl, _, _, _) => Some ( fn_decl) ,
5555 _ => None ,
5656 }
@@ -84,7 +84,7 @@ impl<'hir> Entry<'hir> {
8484 fn associated_body ( self ) -> Option < BodyId > {
8585 match self . node {
8686 Node :: Item ( item) => {
87- match item. node {
87+ match item. kind {
8888 ItemKind :: Const ( _, body) |
8989 ItemKind :: Static ( .., body) |
9090 ItemKind :: Fn ( _, _, _, body) => Some ( body) ,
@@ -293,7 +293,7 @@ impl<'hir> Map<'hir> {
293293
294294 Some ( match node {
295295 Node :: Item ( item) => {
296- match item. node {
296+ match item. kind {
297297 ItemKind :: Static ( ..) => DefKind :: Static ,
298298 ItemKind :: Const ( ..) => DefKind :: Const ,
299299 ItemKind :: Fn ( ..) => DefKind :: Fn ,
@@ -453,19 +453,19 @@ impl<'hir> Map<'hir> {
453453
454454 pub fn body_owner_kind ( & self , id : HirId ) -> BodyOwnerKind {
455455 match self . get ( id) {
456- Node :: Item ( & Item { node : ItemKind :: Const ( ..) , .. } ) |
456+ Node :: Item ( & Item { kind : ItemKind :: Const ( ..) , .. } ) |
457457 Node :: TraitItem ( & TraitItem { kind : TraitItemKind :: Const ( ..) , .. } ) |
458458 Node :: ImplItem ( & ImplItem { kind : ImplItemKind :: Const ( ..) , .. } ) |
459459 Node :: AnonConst ( _) => {
460460 BodyOwnerKind :: Const
461461 }
462462 Node :: Ctor ( ..) |
463- Node :: Item ( & Item { node : ItemKind :: Fn ( ..) , .. } ) |
463+ Node :: Item ( & Item { kind : ItemKind :: Fn ( ..) , .. } ) |
464464 Node :: TraitItem ( & TraitItem { kind : TraitItemKind :: Method ( ..) , .. } ) |
465465 Node :: ImplItem ( & ImplItem { kind : ImplItemKind :: Method ( ..) , .. } ) => {
466466 BodyOwnerKind :: Fn
467467 }
468- Node :: Item ( & Item { node : ItemKind :: Static ( _, m, _) , .. } ) => {
468+ Node :: Item ( & Item { kind : ItemKind :: Static ( _, m, _) , .. } ) => {
469469 BodyOwnerKind :: Static ( m)
470470 }
471471 Node :: Expr ( & Expr { kind : ExprKind :: Closure ( ..) , .. } ) => {
@@ -477,17 +477,17 @@ impl<'hir> Map<'hir> {
477477
478478 pub fn ty_param_owner ( & self , id : HirId ) -> HirId {
479479 match self . get ( id) {
480- Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
481- Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => id,
480+ Node :: Item ( & Item { kind : ItemKind :: Trait ( ..) , .. } ) |
481+ Node :: Item ( & Item { kind : ItemKind :: TraitAlias ( ..) , .. } ) => id,
482482 Node :: GenericParam ( _) => self . get_parent_node ( id) ,
483483 _ => bug ! ( "ty_param_owner: {} not a type parameter" , self . node_to_string( id) )
484484 }
485485 }
486486
487487 pub fn ty_param_name ( & self , id : HirId ) -> Name {
488488 match self . get ( id) {
489- Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
490- Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => kw:: SelfUpper ,
489+ Node :: Item ( & Item { kind : ItemKind :: Trait ( ..) , .. } ) |
490+ Node :: Item ( & Item { kind : ItemKind :: TraitAlias ( ..) , .. } ) => kw:: SelfUpper ,
491491 Node :: GenericParam ( param) => param. name . ident ( ) . name ,
492492 _ => bug ! ( "ty_param_name: {} not a type parameter" , self . node_to_string( id) ) ,
493493 }
@@ -517,7 +517,7 @@ impl<'hir> Map<'hir> {
517517 match self . find_entry ( hir_id) . unwrap ( ) . node {
518518 Node :: Item ( & Item {
519519 span,
520- node : ItemKind :: Mod ( ref m) ,
520+ kind : ItemKind :: Mod ( ref m) ,
521521 ..
522522 } ) => ( m, span, hir_id) ,
523523 Node :: Crate => ( & self . forest . krate . module , self . forest . krate . span , hir_id) ,
@@ -568,7 +568,7 @@ impl<'hir> Map<'hir> {
568568 Node :: ImplItem ( ref impl_item) => Some ( & impl_item. generics ) ,
569569 Node :: TraitItem ( ref trait_item) => Some ( & trait_item. generics ) ,
570570 Node :: Item ( ref item) => {
571- match item. node {
571+ match item. kind {
572572 ItemKind :: Fn ( _, _, ref generics, _) |
573573 ItemKind :: TyAlias ( _, ref generics) |
574574 ItemKind :: Enum ( _, ref generics) |
@@ -649,7 +649,7 @@ impl<'hir> Map<'hir> {
649649 let parent_id = self . get_parent_item ( hir_id) ;
650650 match self . get ( parent_id) {
651651 Node :: Item ( & Item {
652- node : ItemKind :: Const ( ..) ,
652+ kind : ItemKind :: Const ( ..) ,
653653 ..
654654 } )
655655 | Node :: TraitItem ( & TraitItem {
@@ -662,11 +662,11 @@ impl<'hir> Map<'hir> {
662662 } )
663663 | Node :: AnonConst ( _)
664664 | Node :: Item ( & Item {
665- node : ItemKind :: Static ( ..) ,
665+ kind : ItemKind :: Static ( ..) ,
666666 ..
667667 } ) => true ,
668668 Node :: Item ( & Item {
669- node : ItemKind :: Fn ( _, header, ..) ,
669+ kind : ItemKind :: Fn ( _, header, ..) ,
670670 ..
671671 } ) => header. constness == Constness :: Const ,
672672 _ => false ,
@@ -676,7 +676,7 @@ impl<'hir> Map<'hir> {
676676 /// Wether `hir_id` corresponds to a `mod` or a crate.
677677 pub fn is_hir_id_module ( & self , hir_id : HirId ) -> bool {
678678 match self . lookup ( hir_id) {
679- Some ( Entry { node : Node :: Item ( Item { node : ItemKind :: Mod ( _) , .. } ) , .. } ) |
679+ Some ( Entry { node : Node :: Item ( Item { kind : ItemKind :: Mod ( _) , .. } ) , .. } ) |
680680 Some ( Entry { node : Node :: Crate , .. } ) => true ,
681681 _ => false ,
682682 }
@@ -796,7 +796,7 @@ impl<'hir> Map<'hir> {
796796 /// module parent is in this map.
797797 pub fn get_module_parent_node ( & self , hir_id : HirId ) -> HirId {
798798 match self . walk_parent_nodes ( hir_id, |node| match * node {
799- Node :: Item ( & Item { node : ItemKind :: Mod ( _) , .. } ) => true ,
799+ Node :: Item ( & Item { kind : ItemKind :: Mod ( _) , .. } ) => true ,
800800 _ => false ,
801801 } , |_| false ) {
802802 Ok ( id) => id,
@@ -808,7 +808,7 @@ impl<'hir> Map<'hir> {
808808 pub fn get_enclosing_scope ( & self , hir_id : HirId ) -> Option < HirId > {
809809 self . walk_parent_nodes ( hir_id, |node| match * node {
810810 Node :: Item ( i) => {
811- match i. node {
811+ match i. kind {
812812 ItemKind :: Fn ( ..)
813813 | ItemKind :: Mod ( ..)
814814 | ItemKind :: Enum ( ..)
@@ -852,7 +852,7 @@ impl<'hir> Map<'hir> {
852852 }
853853 match self . get ( scope) {
854854 Node :: Item ( i) => {
855- match i. node {
855+ match i. kind {
856856 ItemKind :: OpaqueTy ( OpaqueTy { impl_trait_fn : None , .. } ) => { }
857857 _ => break ,
858858 }
@@ -872,7 +872,7 @@ impl<'hir> Map<'hir> {
872872 let parent = self . get_parent_item ( hir_id) ;
873873 if let Some ( entry) = self . find_entry ( parent) {
874874 if let Entry {
875- node : Node :: Item ( Item { node : ItemKind :: ForeignMod ( ref nm) , .. } ) , .. } = entry
875+ node : Node :: Item ( Item { kind : ItemKind :: ForeignMod ( ref nm) , .. } ) , .. } = entry
876876 {
877877 self . read ( hir_id) ; // reveals some of the content of a node
878878 return nm. abi ;
@@ -905,7 +905,7 @@ impl<'hir> Map<'hir> {
905905 pub fn expect_variant_data ( & self , id : HirId ) -> & ' hir VariantData {
906906 match self . find ( id) {
907907 Some ( Node :: Item ( i) ) => {
908- match i. node {
908+ match i. kind {
909909 ItemKind :: Struct ( ref struct_def, _) |
910910 ItemKind :: Union ( ref struct_def, _) => struct_def,
911911 _ => bug ! ( "struct ID bound to non-struct {}" , self . node_to_string( id) )
@@ -1123,7 +1123,7 @@ impl<'a> NodesMatchingSuffix<'a> {
11231123 }
11241124
11251125 fn item_is_mod ( item : & Item ) -> bool {
1126- match item. node {
1126+ match item. kind {
11271127 ItemKind :: Mod ( _) => true ,
11281128 _ => false ,
11291129 }
@@ -1286,7 +1286,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
12861286
12871287 match map. find ( id) {
12881288 Some ( Node :: Item ( item) ) => {
1289- let item_str = match item. node {
1289+ let item_str = match item. kind {
12901290 ItemKind :: ExternCrate ( ..) => "extern crate" ,
12911291 ItemKind :: Use ( ..) => "use" ,
12921292 ItemKind :: Static ( ..) => "static" ,
0 commit comments