1
1
use std:: iter:: ExactSizeIterator ;
2
2
use std:: ops:: Deref ;
3
3
4
- use rustc_ast:: ast:: { self , FnRetTy , Mutability } ;
4
+ use rustc_ast:: ast:: { self , FnRetTy , Mutability , Term } ;
5
5
use rustc_ast:: ptr;
6
6
use rustc_span:: { symbol:: kw, BytePos , Pos , Span } ;
7
7
@@ -178,7 +178,7 @@ impl<'a> Rewrite for SegmentParam<'a> {
178
178
179
179
impl Rewrite for ast:: AssocConstraint {
180
180
fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
181
- use ast:: AssocConstraintKind :: { Bound , Equality , ConstEquality } ;
181
+ use ast:: AssocConstraintKind :: { Bound , Equality } ;
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::AssocConstraint {
192
192
193
193
let infix = match ( & self . kind , context. config . type_punctuation_density ( ) ) {
194
194
( Bound { .. } , _) => ": " ,
195
- ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Wide ) => " = " ,
196
- ( ConstEquality { .. } | Equality { .. } , TypeDensity :: Compressed ) => "=" ,
195
+ ( Equality { .. } , TypeDensity :: Wide ) => " = " ,
196
+ ( Equality { .. } , TypeDensity :: Compressed ) => "=" ,
197
197
} ;
198
198
result. push_str ( infix) ;
199
199
@@ -209,8 +209,10 @@ impl Rewrite for ast::AssocConstraint {
209
209
impl Rewrite for ast:: AssocConstraintKind {
210
210
fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
211
211
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
+ } ,
214
216
ast:: AssocConstraintKind :: Bound { bounds } => bounds. rewrite ( context, shape) ,
215
217
}
216
218
}
0 commit comments