@@ -141,7 +141,7 @@ pub(crate) enum SegmentParam<'a> {
141
141
Const ( & ' a ast:: AnonConst ) ,
142
142
LifeTime ( & ' a ast:: Lifetime ) ,
143
143
Type ( & ' a ast:: Ty ) ,
144
- Binding ( & ' a ast:: AssocTyConstraint ) ,
144
+ Binding ( & ' a ast:: AssocConstraint ) ,
145
145
}
146
146
147
147
impl < ' a > SegmentParam < ' a > {
@@ -176,9 +176,9 @@ impl<'a> Rewrite for SegmentParam<'a> {
176
176
}
177
177
}
178
178
179
- impl Rewrite for ast:: AssocTyConstraint {
179
+ impl Rewrite for ast:: AssocConstraint {
180
180
fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
181
- use ast:: AssocTyConstraintKind :: { Bound , Equality } ;
181
+ use ast:: AssocConstraintKind :: { Bound , Equality , ConstEquality } ;
182
182
183
183
let mut result = String :: with_capacity ( 128 ) ;
184
184
result. push_str ( rewrite_ident ( context, self . ident ) ) ;
@@ -192,8 +192,8 @@ impl Rewrite for ast::AssocTyConstraint {
192
192
193
193
let infix = match ( & self . kind , context. config . type_punctuation_density ( ) ) {
194
194
( Bound { .. } , _) => ": " ,
195
- ( Equality { .. } , TypeDensity :: Wide ) => " = " ,
196
- ( Equality { .. } , TypeDensity :: Compressed ) => "=" ,
195
+ ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Wide ) => " = " ,
196
+ ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Compressed ) => "=" ,
197
197
} ;
198
198
result. push_str ( infix) ;
199
199
@@ -206,11 +206,12 @@ impl Rewrite for ast::AssocTyConstraint {
206
206
}
207
207
}
208
208
209
- impl Rewrite for ast:: AssocTyConstraintKind {
209
+ impl Rewrite for ast:: AssocConstraintKind {
210
210
fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
211
211
match self {
212
- ast:: AssocTyConstraintKind :: Equality { ty } => ty. rewrite ( context, shape) ,
213
- ast:: AssocTyConstraintKind :: Bound { bounds } => bounds. rewrite ( context, shape) ,
212
+ ast:: AssocConstraintKind :: Equality { ty } => ty. rewrite ( context, shape) ,
213
+ ast:: AssocConstraintKind :: ConstEquality { c } => c. rewrite ( context, shape) ,
214
+ ast:: AssocConstraintKind :: Bound { bounds } => bounds. rewrite ( context, shape) ,
214
215
}
215
216
}
216
217
}
0 commit comments