@@ -135,16 +135,16 @@ pub fn format_expr(
135
135
ast:: ExprKind :: AssignOp ( ref op, ref lhs, ref rhs) => {
136
136
rewrite_assignment ( context, lhs, rhs, Some ( op) , shape)
137
137
}
138
- ast:: ExprKind :: Continue ( ref opt_ident ) => {
139
- let id_str = match * opt_ident {
140
- Some ( ident ) => format ! ( " {}" , ident . node ) ,
138
+ ast:: ExprKind :: Continue ( ref opt_label ) => {
139
+ let id_str = match * opt_label {
140
+ Some ( label ) => format ! ( " {}" , label . ident ) ,
141
141
None => String :: new ( ) ,
142
142
} ;
143
143
Some ( format ! ( "continue{}" , id_str) )
144
144
}
145
- ast:: ExprKind :: Break ( ref opt_ident , ref opt_expr) => {
146
- let id_str = match * opt_ident {
147
- Some ( ident ) => format ! ( " {}" , ident . node ) ,
145
+ ast:: ExprKind :: Break ( ref opt_label , ref opt_expr) => {
146
+ let id_str = match * opt_label {
147
+ Some ( label ) => format ! ( " {}" , label . ident ) ,
148
148
None => String :: new ( ) ,
149
149
} ;
150
150
@@ -159,7 +159,7 @@ pub fn format_expr(
159
159
} else {
160
160
Some ( "yield" . to_string ( ) )
161
161
} ,
162
- ast:: ExprKind :: Closure ( capture, ref fn_decl, ref body, _) => {
162
+ ast:: ExprKind :: Closure ( capture, _ , ref fn_decl, ref body, _) => {
163
163
closures:: rewrite_closure ( capture, fn_decl, body, expr. span , context, shape)
164
164
}
165
165
ast:: ExprKind :: Try ( ..)
@@ -718,7 +718,7 @@ struct ControlFlow<'a> {
718
718
cond : Option < & ' a ast:: Expr > ,
719
719
block : & ' a ast:: Block ,
720
720
else_block : Option < & ' a ast:: Expr > ,
721
- label : Option < ast:: SpannedIdent > ,
721
+ label : Option < ast:: Label > ,
722
722
pat : Option < & ' a ast:: Pat > ,
723
723
keyword : & ' a str ,
724
724
matcher : & ' a str ,
@@ -795,11 +795,7 @@ impl<'a> ControlFlow<'a> {
795
795
}
796
796
}
797
797
798
- fn new_loop (
799
- block : & ' a ast:: Block ,
800
- label : Option < ast:: SpannedIdent > ,
801
- span : Span ,
802
- ) -> ControlFlow < ' a > {
798
+ fn new_loop ( block : & ' a ast:: Block , label : Option < ast:: Label > , span : Span ) -> ControlFlow < ' a > {
803
799
ControlFlow {
804
800
cond : None ,
805
801
block : block,
@@ -819,7 +815,7 @@ impl<'a> ControlFlow<'a> {
819
815
pat : Option < & ' a ast:: Pat > ,
820
816
cond : & ' a ast:: Expr ,
821
817
block : & ' a ast:: Block ,
822
- label : Option < ast:: SpannedIdent > ,
818
+ label : Option < ast:: Label > ,
823
819
span : Span ,
824
820
) -> ControlFlow < ' a > {
825
821
ControlFlow {
@@ -844,7 +840,7 @@ impl<'a> ControlFlow<'a> {
844
840
pat : & ' a ast:: Pat ,
845
841
cond : & ' a ast:: Expr ,
846
842
block : & ' a ast:: Block ,
847
- label : Option < ast:: SpannedIdent > ,
843
+ label : Option < ast:: Label > ,
848
844
span : Span ,
849
845
) -> ControlFlow < ' a > {
850
846
ControlFlow {
@@ -1166,9 +1162,9 @@ impl<'a> Rewrite for ControlFlow<'a> {
1166
1162
}
1167
1163
}
1168
1164
1169
- fn rewrite_label ( label : Option < ast:: SpannedIdent > ) -> Cow < ' static , str > {
1170
- match label {
1171
- Some ( ident ) => Cow :: from ( format ! ( "{}: " , ident . node ) ) ,
1165
+ fn rewrite_label ( opt_label : Option < ast:: Label > ) -> Cow < ' static , str > {
1166
+ match opt_label {
1167
+ Some ( label ) => Cow :: from ( format ! ( "{}: " , label . ident ) ) ,
1172
1168
None => Cow :: from ( "" ) ,
1173
1169
}
1174
1170
}
0 commit comments