@@ -262,7 +262,7 @@ impl<'a> State<'a> {
262262 indented : usize ,
263263 close_box : bool )
264264 -> io:: Result < ( ) > {
265- self . maybe_print_comment ( span. hi ) ?;
265+ self . maybe_print_comment ( span. hi ( ) ) ?;
266266 self . break_offset_if_not_bol ( 1 , -( indented as isize ) ) ?;
267267 self . s . word ( "}" ) ?;
268268 if close_box {
@@ -324,12 +324,12 @@ impl<'a> State<'a> {
324324 let len = elts. len ( ) ;
325325 let mut i = 0 ;
326326 for elt in elts {
327- self . maybe_print_comment ( get_span ( elt) . hi ) ?;
327+ self . maybe_print_comment ( get_span ( elt) . hi ( ) ) ?;
328328 op ( self , elt) ?;
329329 i += 1 ;
330330 if i < len {
331331 self . s . word ( "," ) ?;
332- self . maybe_print_trailing_comment ( get_span ( elt) , Some ( get_span ( & elts[ i] ) . hi ) ) ?;
332+ self . maybe_print_trailing_comment ( get_span ( elt) , Some ( get_span ( & elts[ i] ) . hi ( ) ) ) ?;
333333 self . space_if_not_bol ( ) ?;
334334 }
335335 }
@@ -368,7 +368,7 @@ impl<'a> State<'a> {
368368 }
369369
370370 pub fn print_type ( & mut self , ty : & hir:: Ty ) -> io:: Result < ( ) > {
371- self . maybe_print_comment ( ty. span . lo ) ?;
371+ self . maybe_print_comment ( ty. span . lo ( ) ) ?;
372372 self . ibox ( 0 ) ?;
373373 match ty. node {
374374 hir:: TySlice ( ref ty) => {
@@ -458,7 +458,7 @@ impl<'a> State<'a> {
458458
459459 pub fn print_foreign_item ( & mut self , item : & hir:: ForeignItem ) -> io:: Result < ( ) > {
460460 self . hardbreak_if_not_bol ( ) ?;
461- self . maybe_print_comment ( item. span . lo ) ?;
461+ self . maybe_print_comment ( item. span . lo ( ) ) ?;
462462 self . print_outer_attributes ( & item. attrs ) ?;
463463 match item. node {
464464 hir:: ForeignItemFn ( ref decl, ref arg_names, ref generics) => {
@@ -531,7 +531,7 @@ impl<'a> State<'a> {
531531 /// Pretty-print an item
532532 pub fn print_item ( & mut self , item : & hir:: Item ) -> io:: Result < ( ) > {
533533 self . hardbreak_if_not_bol ( ) ?;
534- self . maybe_print_comment ( item. span . lo ) ?;
534+ self . maybe_print_comment ( item. span . lo ( ) ) ?;
535535 self . print_outer_attributes ( & item. attrs ) ?;
536536 self . ann . pre ( self , NodeItem ( item) ) ?;
537537 match item. node {
@@ -797,7 +797,7 @@ impl<'a> State<'a> {
797797 self . bopen ( ) ?;
798798 for v in variants {
799799 self . space_if_not_bol ( ) ?;
800- self . maybe_print_comment ( v. span . lo ) ?;
800+ self . maybe_print_comment ( v. span . lo ( ) ) ?;
801801 self . print_outer_attributes ( & v. node . attrs ) ?;
802802 self . ibox ( indent_unit) ?;
803803 self . print_variant ( v) ?;
@@ -842,7 +842,7 @@ impl<'a> State<'a> {
842842 if struct_def. is_tuple ( ) {
843843 self . popen ( ) ?;
844844 self . commasep ( Inconsistent , struct_def. fields ( ) , |s, field| {
845- s. maybe_print_comment ( field. span . lo ) ?;
845+ s. maybe_print_comment ( field. span . lo ( ) ) ?;
846846 s. print_outer_attributes ( & field. attrs ) ?;
847847 s. print_visibility ( & field. vis ) ?;
848848 s. print_type ( & field. ty )
@@ -863,7 +863,7 @@ impl<'a> State<'a> {
863863
864864 for field in struct_def. fields ( ) {
865865 self . hardbreak_if_not_bol ( ) ?;
866- self . maybe_print_comment ( field. span . lo ) ?;
866+ self . maybe_print_comment ( field. span . lo ( ) ) ?;
867867 self . print_outer_attributes ( & field. attrs ) ?;
868868 self . print_visibility ( & field. vis ) ?;
869869 self . print_name ( field. name ) ?;
@@ -908,7 +908,7 @@ impl<'a> State<'a> {
908908 pub fn print_trait_item ( & mut self , ti : & hir:: TraitItem ) -> io:: Result < ( ) > {
909909 self . ann . pre ( self , NodeSubItem ( ti. id ) ) ?;
910910 self . hardbreak_if_not_bol ( ) ?;
911- self . maybe_print_comment ( ti. span . lo ) ?;
911+ self . maybe_print_comment ( ti. span . lo ( ) ) ?;
912912 self . print_outer_attributes ( & ti. attrs ) ?;
913913 match ti. node {
914914 hir:: TraitItemKind :: Const ( ref ty, default) => {
@@ -938,7 +938,7 @@ impl<'a> State<'a> {
938938 pub fn print_impl_item ( & mut self , ii : & hir:: ImplItem ) -> io:: Result < ( ) > {
939939 self . ann . pre ( self , NodeSubItem ( ii. id ) ) ?;
940940 self . hardbreak_if_not_bol ( ) ?;
941- self . maybe_print_comment ( ii. span . lo ) ?;
941+ self . maybe_print_comment ( ii. span . lo ( ) ) ?;
942942 self . print_outer_attributes ( & ii. attrs ) ?;
943943 self . print_defaultness ( ii. defaultness ) ?;
944944
@@ -962,7 +962,7 @@ impl<'a> State<'a> {
962962 }
963963
964964 pub fn print_stmt ( & mut self , st : & hir:: Stmt ) -> io:: Result < ( ) > {
965- self . maybe_print_comment ( st. span . lo ) ?;
965+ self . maybe_print_comment ( st. span . lo ( ) ) ?;
966966 match st. node {
967967 hir:: StmtDecl ( ref decl, _) => {
968968 self . print_decl ( & decl) ?;
@@ -1017,7 +1017,7 @@ impl<'a> State<'a> {
10171017 hir:: PopUnsafeBlock ( ..) => self . word_space ( "pop_unsafe" ) ?,
10181018 hir:: DefaultBlock => ( ) ,
10191019 }
1020- self . maybe_print_comment ( blk. span . lo ) ?;
1020+ self . maybe_print_comment ( blk. span . lo ( ) ) ?;
10211021 self . ann . pre ( self , NodeBlock ( blk) ) ?;
10221022 self . bopen ( ) ?;
10231023
@@ -1030,7 +1030,7 @@ impl<'a> State<'a> {
10301030 Some ( ref expr) => {
10311031 self . space_if_not_bol ( ) ?;
10321032 self . print_expr ( & expr) ?;
1033- self . maybe_print_trailing_comment ( expr. span , Some ( blk. span . hi ) ) ?;
1033+ self . maybe_print_trailing_comment ( expr. span , Some ( blk. span . hi ( ) ) ) ?;
10341034 }
10351035 _ => ( ) ,
10361036 }
@@ -1228,7 +1228,7 @@ impl<'a> State<'a> {
12281228 }
12291229
12301230 pub fn print_expr ( & mut self , expr : & hir:: Expr ) -> io:: Result < ( ) > {
1231- self . maybe_print_comment ( expr. span . lo ) ?;
1231+ self . maybe_print_comment ( expr. span . lo ( ) ) ?;
12321232 self . print_outer_attributes ( & expr. attrs ) ?;
12331233 self . ibox ( indent_unit) ?;
12341234 self . ann . pre ( self , NodeExpr ( expr) ) ?;
@@ -1480,7 +1480,7 @@ impl<'a> State<'a> {
14801480 }
14811481
14821482 pub fn print_decl ( & mut self , decl : & hir:: Decl ) -> io:: Result < ( ) > {
1483- self . maybe_print_comment ( decl. span . lo ) ?;
1483+ self . maybe_print_comment ( decl. span . lo ( ) ) ?;
14841484 match decl. node {
14851485 hir:: DeclLocal ( ref loc) => {
14861486 self . space_if_not_bol ( ) ?;
@@ -1523,7 +1523,7 @@ impl<'a> State<'a> {
15231523 path : & hir:: Path ,
15241524 colons_before_params : bool )
15251525 -> io:: Result < ( ) > {
1526- self . maybe_print_comment ( path. span . lo ) ?;
1526+ self . maybe_print_comment ( path. span . lo ( ) ) ?;
15271527
15281528 for ( i, segment) in path. segments . iter ( ) . enumerate ( ) {
15291529 if i > 0 {
@@ -1641,7 +1641,7 @@ impl<'a> State<'a> {
16411641 }
16421642
16431643 pub fn print_pat ( & mut self , pat : & hir:: Pat ) -> io:: Result < ( ) > {
1644- self . maybe_print_comment ( pat. span . lo ) ?;
1644+ self . maybe_print_comment ( pat. span . lo ( ) ) ?;
16451645 self . ann . pre ( self , NodePat ( pat) ) ?;
16461646 // Pat isn't normalized, but the beauty of it
16471647 // is that it doesn't matter
@@ -1897,7 +1897,7 @@ impl<'a> State<'a> {
18971897 match decl. output {
18981898 hir:: Return ( ref ty) => {
18991899 self . print_type ( & ty) ?;
1900- self . maybe_print_comment ( ty. span . lo )
1900+ self . maybe_print_comment ( ty. span . lo ( ) )
19011901 }
19021902 hir:: DefaultReturn ( ..) => unreachable ! ( ) ,
19031903 }
@@ -2074,7 +2074,7 @@ impl<'a> State<'a> {
20742074 self . end ( ) ?;
20752075
20762076 match decl. output {
2077- hir:: Return ( ref output) => self . maybe_print_comment ( output. span . lo ) ,
2077+ hir:: Return ( ref output) => self . maybe_print_comment ( output. span . lo ( ) ) ,
20782078 _ => Ok ( ( ) ) ,
20792079 }
20802080 }
@@ -2124,13 +2124,13 @@ impl<'a> State<'a> {
21242124 if ( * cmnt) . style != comments:: Trailing {
21252125 return Ok ( ( ) ) ;
21262126 }
2127- let span_line = cm. lookup_char_pos ( span. hi ) ;
2127+ let span_line = cm. lookup_char_pos ( span. hi ( ) ) ;
21282128 let comment_line = cm. lookup_char_pos ( ( * cmnt) . pos ) ;
21292129 let mut next = ( * cmnt) . pos + BytePos ( 1 ) ;
21302130 if let Some ( p) = next_pos {
21312131 next = p;
21322132 }
2133- if span. hi < ( * cmnt) . pos && ( * cmnt) . pos < next &&
2133+ if span. hi ( ) < ( * cmnt) . pos && ( * cmnt) . pos < next &&
21342134 span_line. line == comment_line. line {
21352135 self . print_comment ( cmnt) ?;
21362136 }
0 commit comments