@@ -464,7 +464,7 @@ impl<'a> State<'a> {
464464
465465 pub fn print_foreign_item ( & mut self , item : & hir:: ForeignItem < ' _ > ) {
466466 self . hardbreak_if_not_bol ( ) ;
467- self . maybe_print_comment ( item . span . lo ( ) ) ;
467+ self . maybe_print_comment ( self . span ( item . hir_id ( ) ) . lo ( ) ) ;
468468 self . print_outer_attributes ( self . attrs ( item. hir_id ( ) ) ) ;
469469 match item. kind {
470470 hir:: ForeignItemKind :: Fn ( ref decl, ref arg_names, ref generics) => {
@@ -572,7 +572,7 @@ impl<'a> State<'a> {
572572 /// Pretty-print an item
573573 pub fn print_item ( & mut self , item : & hir:: Item < ' _ > ) {
574574 self . hardbreak_if_not_bol ( ) ;
575- self . maybe_print_comment ( item . span . lo ( ) ) ;
575+ self . maybe_print_comment ( self . span ( item . hir_id ( ) ) . lo ( ) ) ;
576576 let attrs = self . attrs ( item. hir_id ( ) ) ;
577577 self . print_outer_attributes ( attrs) ;
578578 self . ann . pre ( self , AnnNode :: Item ( item) ) ;
@@ -660,7 +660,7 @@ impl<'a> State<'a> {
660660 self . nbsp ( ) ;
661661 self . bopen ( ) ;
662662 self . print_mod ( _mod, attrs) ;
663- self . bclose ( item . span ) ;
663+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
664664 }
665665 hir:: ItemKind :: ForeignMod { abi, items } => {
666666 self . head ( "extern" ) ;
@@ -670,7 +670,7 @@ impl<'a> State<'a> {
670670 for item in items {
671671 self . ann . nested ( self , Nested :: ForeignItem ( item. id ) ) ;
672672 }
673- self . bclose ( item . span ) ;
673+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
674674 }
675675 hir:: ItemKind :: GlobalAsm ( ref ga) => {
676676 self . head ( visibility_qualified ( & item. vis , "global asm" ) ) ;
@@ -699,15 +699,33 @@ impl<'a> State<'a> {
699699 } ) ;
700700 }
701701 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+ ) ;
703709 }
704710 hir:: ItemKind :: Struct ( ref struct_def, ref generics) => {
705711 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+ ) ;
707719 }
708720 hir:: ItemKind :: Union ( ref struct_def, ref generics) => {
709721 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+ ) ;
711729 }
712730 hir:: ItemKind :: Impl ( hir:: Impl {
713731 unsafety,
@@ -754,7 +772,7 @@ impl<'a> State<'a> {
754772 for impl_item in items {
755773 self . ann . nested ( self , Nested :: ImplItem ( impl_item. id ) ) ;
756774 }
757- self . bclose ( item . span ) ;
775+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
758776 }
759777 hir:: ItemKind :: Trait ( is_auto, unsafety, ref generics, ref bounds, trait_items) => {
760778 self . head ( "" ) ;
@@ -781,7 +799,7 @@ impl<'a> State<'a> {
781799 for trait_item in trait_items {
782800 self . ann . nested ( self , Nested :: TraitItem ( trait_item. id ) ) ;
783801 }
784- self . bclose ( item . span ) ;
802+ self . bclose ( self . span ( item . hir_id ( ) ) ) ;
785803 }
786804 hir:: ItemKind :: TraitAlias ( ref generics, ref bounds) => {
787805 self . head ( "" ) ;
@@ -964,7 +982,7 @@ impl<'a> State<'a> {
964982 pub fn print_trait_item ( & mut self , ti : & hir:: TraitItem < ' _ > ) {
965983 self . ann . pre ( self , AnnNode :: SubItem ( ti. hir_id ( ) ) ) ;
966984 self . hardbreak_if_not_bol ( ) ;
967- self . maybe_print_comment ( ti . span . lo ( ) ) ;
985+ self . maybe_print_comment ( self . span ( ti . hir_id ( ) ) . lo ( ) ) ;
968986 self . print_outer_attributes ( self . attrs ( ti. hir_id ( ) ) ) ;
969987 match ti. kind {
970988 hir:: TraitItemKind :: Const ( ref ty, default) => {
@@ -1003,7 +1021,7 @@ impl<'a> State<'a> {
10031021 pub fn print_impl_item ( & mut self , ii : & hir:: ImplItem < ' _ > ) {
10041022 self . ann . pre ( self , AnnNode :: SubItem ( ii. hir_id ( ) ) ) ;
10051023 self . hardbreak_if_not_bol ( ) ;
1006- self . maybe_print_comment ( ii . span . lo ( ) ) ;
1024+ self . maybe_print_comment ( self . span ( ii . hir_id ( ) ) . lo ( ) ) ;
10071025 self . print_outer_attributes ( self . attrs ( ii. hir_id ( ) ) ) ;
10081026 self . print_defaultness ( ii. defaultness ) ;
10091027
0 commit comments