@@ -141,7 +141,7 @@ pub(crate) enum SegmentParam<'a> {
141141 Const ( & ' a ast:: AnonConst ) ,
142142 LifeTime ( & ' a ast:: Lifetime ) ,
143143 Type ( & ' a ast:: Ty ) ,
144- Binding ( & ' a ast:: AssocTyConstraint ) ,
144+ Binding ( & ' a ast:: AssocConstraint ) ,
145145}
146146
147147impl < ' a > SegmentParam < ' a > {
@@ -176,9 +176,9 @@ impl<'a> Rewrite for SegmentParam<'a> {
176176 }
177177}
178178
179- impl Rewrite for ast:: AssocTyConstraint {
179+ impl Rewrite for ast:: AssocConstraint {
180180 fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
181- use ast:: AssocTyConstraintKind :: { Bound , Equality } ;
181+ use ast:: AssocConstraintKind :: { Bound , Equality , ConstEquality } ;
182182
183183 let mut result = String :: with_capacity ( 128 ) ;
184184 result. push_str ( rewrite_ident ( context, self . ident ) ) ;
@@ -192,8 +192,8 @@ impl Rewrite for ast::AssocTyConstraint {
192192
193193 let infix = match ( & self . kind , context. config . type_punctuation_density ( ) ) {
194194 ( Bound { .. } , _) => ": " ,
195- ( Equality { .. } , TypeDensity :: Wide ) => " = " ,
196- ( Equality { .. } , TypeDensity :: Compressed ) => "=" ,
195+ ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Wide ) => " = " ,
196+ ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Compressed ) => "=" ,
197197 } ;
198198 result. push_str ( infix) ;
199199
@@ -206,11 +206,12 @@ impl Rewrite for ast::AssocTyConstraint {
206206 }
207207}
208208
209- impl Rewrite for ast:: AssocTyConstraintKind {
209+ impl Rewrite for ast:: AssocConstraintKind {
210210 fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
211211 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) ,
214215 }
215216 }
216217}
0 commit comments