@@ -464,7 +464,7 @@ impl<'a> State<'a> {
464
464
465
465
pub fn print_foreign_item ( & mut self , item : & hir:: ForeignItem < ' _ > ) {
466
466
self . hardbreak_if_not_bol ( ) ;
467
- self . maybe_print_comment ( item . span . lo ( ) ) ;
467
+ self . maybe_print_comment ( self . span ( item . hir_id ( ) ) . lo ( ) ) ;
468
468
self . print_outer_attributes ( self . attrs ( item. hir_id ( ) ) ) ;
469
469
match item. kind {
470
470
hir:: ForeignItemKind :: Fn ( ref decl, ref arg_names, ref generics) => {
@@ -572,7 +572,7 @@ impl<'a> State<'a> {
572
572
/// Pretty-print an item
573
573
pub fn print_item ( & mut self , item : & hir:: Item < ' _ > ) {
574
574
self . hardbreak_if_not_bol ( ) ;
575
- self . maybe_print_comment ( item . span . lo ( ) ) ;
575
+ self . maybe_print_comment ( self . span ( item . hir_id ( ) ) . lo ( ) ) ;
576
576
let attrs = self . attrs ( item. hir_id ( ) ) ;
577
577
self . print_outer_attributes ( attrs) ;
578
578
self . ann . pre ( self , AnnNode :: Item ( item) ) ;
@@ -660,7 +660,7 @@ impl<'a> State<'a> {
660
660
self . nbsp ( ) ;
661
661
self . bopen ( ) ;
662
662
self . print_mod ( _mod, attrs) ;
663
- self . bclose ( item . span ) ;
663
+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
664
664
}
665
665
hir:: ItemKind :: ForeignMod { abi, items } => {
666
666
self . head ( "extern" ) ;
@@ -670,7 +670,7 @@ impl<'a> State<'a> {
670
670
for item in items {
671
671
self . ann . nested ( self , Nested :: ForeignItem ( item. id ) ) ;
672
672
}
673
- self . bclose ( item . span ) ;
673
+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
674
674
}
675
675
hir:: ItemKind :: GlobalAsm ( ref ga) => {
676
676
self . head ( visibility_qualified ( & item. vis , "global asm" ) ) ;
@@ -699,15 +699,33 @@ impl<'a> State<'a> {
699
699
} ) ;
700
700
}
701
701
hir:: ItemKind :: Enum ( ref enum_definition, ref params) => {
702
- self . print_enum_def ( enum_definition, params, item. ident . name , item. span , & item. vis ) ;
702
+ self . print_enum_def (
703
+ enum_definition,
704
+ params,
705
+ item. ident . name ,
706
+ self . span ( item. hir_id ( ) ) ,
707
+ & item. vis ,
708
+ ) ;
703
709
}
704
710
hir:: ItemKind :: Struct ( ref struct_def, ref generics) => {
705
711
self . head ( visibility_qualified ( & item. vis , "struct" ) ) ;
706
- self . print_struct ( struct_def, generics, item. ident . name , item. span , true ) ;
712
+ self . print_struct (
713
+ struct_def,
714
+ generics,
715
+ item. ident . name ,
716
+ self . span ( item. hir_id ( ) ) ,
717
+ true ,
718
+ ) ;
707
719
}
708
720
hir:: ItemKind :: Union ( ref struct_def, ref generics) => {
709
721
self . head ( visibility_qualified ( & item. vis , "union" ) ) ;
710
- self . print_struct ( struct_def, generics, item. ident . name , item. span , true ) ;
722
+ self . print_struct (
723
+ struct_def,
724
+ generics,
725
+ item. ident . name ,
726
+ self . span ( item. hir_id ( ) ) ,
727
+ true ,
728
+ ) ;
711
729
}
712
730
hir:: ItemKind :: Impl ( hir:: Impl {
713
731
unsafety,
@@ -754,7 +772,7 @@ impl<'a> State<'a> {
754
772
for impl_item in items {
755
773
self . ann . nested ( self , Nested :: ImplItem ( impl_item. id ) ) ;
756
774
}
757
- self . bclose ( item . span ) ;
775
+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
758
776
}
759
777
hir:: ItemKind :: Trait ( is_auto, unsafety, ref generics, ref bounds, trait_items) => {
760
778
self . head ( "" ) ;
@@ -781,7 +799,7 @@ impl<'a> State<'a> {
781
799
for trait_item in trait_items {
782
800
self . ann . nested ( self , Nested :: TraitItem ( trait_item. id ) ) ;
783
801
}
784
- self . bclose ( item . span ) ;
802
+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
785
803
}
786
804
hir:: ItemKind :: TraitAlias ( ref generics, ref bounds) => {
787
805
self . head ( "" ) ;
@@ -964,7 +982,7 @@ impl<'a> State<'a> {
964
982
pub fn print_trait_item ( & mut self , ti : & hir:: TraitItem < ' _ > ) {
965
983
self . ann . pre ( self , AnnNode :: SubItem ( ti. hir_id ( ) ) ) ;
966
984
self . hardbreak_if_not_bol ( ) ;
967
- self . maybe_print_comment ( ti . span . lo ( ) ) ;
985
+ self . maybe_print_comment ( self . span ( ti . hir_id ( ) ) . lo ( ) ) ;
968
986
self . print_outer_attributes ( self . attrs ( ti. hir_id ( ) ) ) ;
969
987
match ti. kind {
970
988
hir:: TraitItemKind :: Const ( ref ty, default) => {
@@ -1003,7 +1021,7 @@ impl<'a> State<'a> {
1003
1021
pub fn print_impl_item ( & mut self , ii : & hir:: ImplItem < ' _ > ) {
1004
1022
self . ann . pre ( self , AnnNode :: SubItem ( ii. hir_id ( ) ) ) ;
1005
1023
self . hardbreak_if_not_bol ( ) ;
1006
- self . maybe_print_comment ( ii . span . lo ( ) ) ;
1024
+ self . maybe_print_comment ( self . span ( ii . hir_id ( ) ) . lo ( ) ) ;
1007
1025
self . print_outer_attributes ( self . attrs ( ii. hir_id ( ) ) ) ;
1008
1026
self . print_defaultness ( ii. defaultness ) ;
1009
1027
0 commit comments