|
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 |
|
@@ -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}; |
182 | 182 |
|
183 | 183 | let mut result = String::with_capacity(128);
|
184 | 184 | result.push_str(rewrite_ident(context, self.ident));
|
@@ -206,11 +206,14 @@ 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 { term } => match term { |
| 213 | + Term::Ty(ty) => ty.rewrite(context, shape), |
| 214 | + Term::Const(c) => c.rewrite(context, shape), |
| 215 | + }, |
| 216 | + ast::AssocConstraintKind::Bound { bounds } => bounds.rewrite(context, shape), |
214 | 217 | }
|
215 | 218 | }
|
216 | 219 | }
|
|
0 commit comments