88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- pub use self :: AnnNode :: * ;
12-
1311use rustc_target:: spec:: abi:: Abi ;
1412use syntax:: ast;
1513use syntax:: source_map:: { SourceMap , Spanned } ;
@@ -33,12 +31,12 @@ use std::iter::Peekable;
3331use std:: vec;
3432
3533pub enum AnnNode < ' a > {
36- NodeName ( & ' a ast:: Name ) ,
37- NodeBlock ( & ' a hir:: Block ) ,
38- NodeItem ( & ' a hir:: Item ) ,
39- NodeSubItem ( ast:: NodeId ) ,
40- NodeExpr ( & ' a hir:: Expr ) ,
41- NodePat ( & ' a hir:: Pat ) ,
34+ Name ( & ' a ast:: Name ) ,
35+ Block ( & ' a hir:: Block ) ,
36+ Item ( & ' a hir:: Item ) ,
37+ SubItem ( ast:: NodeId ) ,
38+ Expr ( & ' a hir:: Expr ) ,
39+ Pat ( & ' a hir:: Pat ) ,
4240}
4341
4442pub enum Nested {
@@ -529,7 +527,7 @@ impl<'a> State<'a> {
529527 self . hardbreak_if_not_bol ( ) ?;
530528 self . maybe_print_comment ( item. span . lo ( ) ) ?;
531529 self . print_outer_attributes ( & item. attrs ) ?;
532- self . ann . pre ( self , NodeItem ( item) ) ?;
530+ self . ann . pre ( self , AnnNode :: Item ( item) ) ?;
533531 match item. node {
534532 hir:: ItemKind :: ExternCrate ( orig_name) => {
535533 self . head ( & visibility_qualified ( & item. vis , "extern crate" ) ) ?;
@@ -768,7 +766,7 @@ impl<'a> State<'a> {
768766 self . s . word ( ";" ) ?;
769767 }
770768 }
771- self . ann . post ( self , NodeItem ( item) )
769+ self . ann . post ( self , AnnNode :: Item ( item) )
772770 }
773771
774772 pub fn print_trait_ref ( & mut self , t : & hir:: TraitRef ) -> io:: Result < ( ) > {
@@ -933,7 +931,7 @@ impl<'a> State<'a> {
933931 }
934932
935933 pub fn print_trait_item ( & mut self , ti : & hir:: TraitItem ) -> io:: Result < ( ) > {
936- self . ann . pre ( self , NodeSubItem ( ti. id ) ) ?;
934+ self . ann . pre ( self , AnnNode :: SubItem ( ti. id ) ) ?;
937935 self . hardbreak_if_not_bol ( ) ?;
938936 self . maybe_print_comment ( ti. span . lo ( ) ) ?;
939937 self . print_outer_attributes ( & ti. attrs ) ?;
@@ -965,11 +963,11 @@ impl<'a> State<'a> {
965963 default. as_ref ( ) . map ( |ty| & * * ty) ) ?;
966964 }
967965 }
968- self . ann . post ( self , NodeSubItem ( ti. id ) )
966+ self . ann . post ( self , AnnNode :: SubItem ( ti. id ) )
969967 }
970968
971969 pub fn print_impl_item ( & mut self , ii : & hir:: ImplItem ) -> io:: Result < ( ) > {
972- self . ann . pre ( self , NodeSubItem ( ii. id ) ) ?;
970+ self . ann . pre ( self , AnnNode :: SubItem ( ii. id ) ) ?;
973971 self . hardbreak_if_not_bol ( ) ?;
974972 self . maybe_print_comment ( ii. span . lo ( ) ) ?;
975973 self . print_outer_attributes ( & ii. attrs ) ?;
@@ -995,7 +993,7 @@ impl<'a> State<'a> {
995993 self . print_associated_type ( ii. ident , Some ( bounds) , None ) ?;
996994 }
997995 }
998- self . ann . post ( self , NodeSubItem ( ii. id ) )
996+ self . ann . post ( self , AnnNode :: SubItem ( ii. id ) )
999997 }
1000998
1001999 pub fn print_stmt ( & mut self , st : & hir:: Stmt ) -> io:: Result < ( ) > {
@@ -1055,7 +1053,7 @@ impl<'a> State<'a> {
10551053 hir:: DefaultBlock => ( ) ,
10561054 }
10571055 self . maybe_print_comment ( blk. span . lo ( ) ) ?;
1058- self . ann . pre ( self , NodeBlock ( blk) ) ?;
1056+ self . ann . pre ( self , AnnNode :: Block ( blk) ) ?;
10591057 self . bopen ( ) ?;
10601058
10611059 self . print_inner_attributes ( attrs) ?;
@@ -1072,7 +1070,7 @@ impl<'a> State<'a> {
10721070 _ => ( ) ,
10731071 }
10741072 self . bclose_maybe_open ( blk. span , indented, close_box) ?;
1075- self . ann . post ( self , NodeBlock ( blk) )
1073+ self . ann . post ( self , AnnNode :: Block ( blk) )
10761074 }
10771075
10781076 fn print_else ( & mut self , els : Option < & hir:: Expr > ) -> io:: Result < ( ) > {
@@ -1321,7 +1319,7 @@ impl<'a> State<'a> {
13211319 self . maybe_print_comment ( expr. span . lo ( ) ) ?;
13221320 self . print_outer_attributes ( & expr. attrs ) ?;
13231321 self . ibox ( indent_unit) ?;
1324- self . ann . pre ( self , NodeExpr ( expr) ) ?;
1322+ self . ann . pre ( self , AnnNode :: Expr ( expr) ) ?;
13251323 match expr. node {
13261324 hir:: ExprKind :: Box ( ref expr) => {
13271325 self . word_space ( "box" ) ?;
@@ -1559,7 +1557,7 @@ impl<'a> State<'a> {
15591557 self . print_expr_maybe_paren ( & expr, parser:: PREC_JUMP ) ?;
15601558 }
15611559 }
1562- self . ann . post ( self , NodeExpr ( expr) ) ?;
1560+ self . ann . post ( self , AnnNode :: Expr ( expr) ) ?;
15631561 self . end ( )
15641562 }
15651563
@@ -1606,7 +1604,7 @@ impl<'a> State<'a> {
16061604 } else {
16071605 self . s . word ( & ident. as_str ( ) ) ?;
16081606 }
1609- self . ann . post ( self , NodeName ( & ident. name ) )
1607+ self . ann . post ( self , AnnNode :: Name ( & ident. name ) )
16101608 }
16111609
16121610 pub fn print_name ( & mut self , name : ast:: Name ) -> io:: Result < ( ) > {
@@ -1774,7 +1772,7 @@ impl<'a> State<'a> {
17741772
17751773 pub fn print_pat ( & mut self , pat : & hir:: Pat ) -> io:: Result < ( ) > {
17761774 self . maybe_print_comment ( pat. span . lo ( ) ) ?;
1777- self . ann . pre ( self , NodePat ( pat) ) ?;
1775+ self . ann . pre ( self , AnnNode :: Pat ( pat) ) ?;
17781776 // Pat isn't normalized, but the beauty of it
17791777 // is that it doesn't matter
17801778 match pat. node {
@@ -1928,7 +1926,7 @@ impl<'a> State<'a> {
19281926 self . s . word ( "]" ) ?;
19291927 }
19301928 }
1931- self . ann . post ( self , NodePat ( pat) )
1929+ self . ann . post ( self , AnnNode :: Pat ( pat) )
19321930 }
19331931
19341932 fn print_arm ( & mut self , arm : & hir:: Arm ) -> io:: Result < ( ) > {
0 commit comments