11use std:: iter:: ExactSizeIterator ;
22use std:: ops:: Deref ;
33
4- use rustc_ast:: ast:: { self , FnRetTy , Mutability } ;
4+ use rustc_ast:: ast:: { self , FnRetTy , Mutability , Term } ;
55use rustc_ast:: ptr;
66use rustc_span:: { symbol:: kw, BytePos , Pos , Span } ;
77
@@ -178,7 +178,7 @@ impl<'a> Rewrite for SegmentParam<'a> {
178178
179179impl Rewrite for ast:: AssocConstraint {
180180 fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
181- use ast:: AssocConstraintKind :: { Bound , Equality , ConstEquality } ;
181+ use ast:: AssocConstraintKind :: { Bound , Equality } ;
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::AssocConstraint {
192192
193193 let infix = match ( & self . kind , context. config . type_punctuation_density ( ) ) {
194194 ( Bound { .. } , _) => ": " ,
195- ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Wide ) => " = " ,
196- ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Compressed ) => "=" ,
195+ ( Equality { .. } , TypeDensity :: Wide ) => " = " ,
196+ ( Equality { .. } , TypeDensity :: Compressed ) => "=" ,
197197 } ;
198198 result. push_str ( infix) ;
199199
@@ -209,8 +209,10 @@ impl Rewrite for ast::AssocConstraint {
209209impl Rewrite for ast:: AssocConstraintKind {
210210 fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
211211 match self {
212- ast:: AssocConstraintKind :: Equality { ty } => ty. rewrite ( context, shape) ,
213- ast:: AssocConstraintKind :: ConstEquality { c } => c. rewrite ( context, shape) ,
212+ ast:: AssocConstraintKind :: Equality { term } => match term {
213+ Term :: Ty ( ty) => ty. rewrite ( context, shape) ,
214+ Term :: Const ( c) => c. rewrite ( context, shape) ,
215+ } ,
214216 ast:: AssocConstraintKind :: Bound { bounds } => bounds. rewrite ( context, shape) ,
215217 }
216218 }
0 commit comments