@@ -367,6 +367,10 @@ pub fn generics_to_string(generics: &ast::Generics) -> String {
367367 $to_string( |s| s. print_generics( generics) )
368368}
369369
370+ pub fn where_clause_to_string( i: & ast:: WhereClause ) -> String {
371+ $to_string( |s| s. print_where_clause( i) )
372+ }
373+
370374pub fn fn_block_to_string( p: & ast:: FnDecl ) -> String {
371375 $to_string( |s| s. print_fn_block_args( p) )
372376}
@@ -912,7 +916,7 @@ impl<'a> State<'a> {
912916 try!( space ( & mut self . s ) ) ;
913917 try!( self . word_space ( "=" ) ) ;
914918 try!( self . print_type ( & * * ty) ) ;
915- try!( self . print_where_clause ( params) ) ;
919+ try!( self . print_where_clause ( & params. where_clause ) ) ;
916920 try!( word ( & mut self . s , ";" ) ) ;
917921 try!( self . end ( ) ) ; // end the outer ibox
918922 }
@@ -975,7 +979,7 @@ impl<'a> State<'a> {
975979 }
976980
977981 try!( self . print_type ( & * * ty) ) ;
978- try!( self . print_where_clause ( generics) ) ;
982+ try!( self . print_where_clause ( & generics. where_clause ) ) ;
979983
980984 try!( space ( & mut self . s ) ) ;
981985 try!( self . bopen ( ) ) ;
@@ -1003,7 +1007,7 @@ impl<'a> State<'a> {
10031007 }
10041008 }
10051009 try!( self . print_bounds ( ":" , & real_bounds[ ..] ) ) ;
1006- try!( self . print_where_clause ( generics) ) ;
1010+ try!( self . print_where_clause ( & generics. where_clause ) ) ;
10071011 try!( word ( & mut self . s , " " ) ) ;
10081012 try!( self . bopen ( ) ) ;
10091013 for trait_item in trait_items {
@@ -1061,7 +1065,7 @@ impl<'a> State<'a> {
10611065 try!( self . head ( & visibility_qualified ( visibility, "enum" ) ) ) ;
10621066 try!( self . print_ident ( ident) ) ;
10631067 try!( self . print_generics ( generics) ) ;
1064- try!( self . print_where_clause ( generics) ) ;
1068+ try!( self . print_where_clause ( & generics. where_clause ) ) ;
10651069 try!( space ( & mut self . s ) ) ;
10661070 self . print_variants ( & enum_definition. variants , span)
10671071 }
@@ -1115,12 +1119,12 @@ impl<'a> State<'a> {
11151119 ) ) ;
11161120 try!( self . pclose ( ) ) ;
11171121 }
1118- try!( self . print_where_clause ( generics) ) ;
1122+ try!( self . print_where_clause ( & generics. where_clause ) ) ;
11191123 try!( word ( & mut self . s , ";" ) ) ;
11201124 try!( self . end ( ) ) ;
11211125 self . end ( ) // close the outer-box
11221126 } else {
1123- try!( self . print_where_clause ( generics) ) ;
1127+ try!( self . print_where_clause ( & generics. where_clause ) ) ;
11241128 try!( self . nbsp ( ) ) ;
11251129 try!( self . bopen ( ) ) ;
11261130 try!( self . hardbreak_if_not_bol ( ) ) ;
@@ -2343,7 +2347,7 @@ impl<'a> State<'a> {
23432347 }
23442348 try!( self . print_generics ( generics) ) ;
23452349 try!( self . print_fn_args_and_ret ( decl, opt_explicit_self) ) ;
2346- self . print_where_clause ( generics)
2350+ self . print_where_clause ( & generics. where_clause )
23472351 }
23482352
23492353 pub fn print_fn_args ( & mut self , decl : & ast:: FnDecl ,
@@ -2526,19 +2530,16 @@ impl<'a> State<'a> {
25262530 }
25272531 }
25282532
2529- pub fn print_where_clause ( & mut self , generics : & ast:: Generics )
2533+ pub fn print_where_clause ( & mut self , where_clause : & ast:: WhereClause )
25302534 -> io:: Result < ( ) > {
2531- if generics . where_clause . predicates . len ( ) == 0 {
2535+ if where_clause. predicates . len ( ) == 0 {
25322536 return Ok ( ( ) )
25332537 }
25342538
25352539 try!( space ( & mut self . s ) ) ;
25362540 try!( self . word_space ( "where" ) ) ;
25372541
2538- for ( i, predicate) in generics. where_clause
2539- . predicates
2540- . iter ( )
2541- . enumerate ( ) {
2542+ for ( i, predicate) in where_clause. predicates . iter ( ) . enumerate ( ) {
25422543 if i != 0 {
25432544 try!( self . word_space ( "," ) ) ;
25442545 }
0 commit comments