From fb57b7518d207caa99bdd99f4dab2a7d3902a83a Mon Sep 17 00:00:00 2001 From: kadmin Date: Fri, 7 Jan 2022 03:58:32 +0000 Subject: Add term Instead of having a separate enum variant for types and consts have one but have either a const or type. --- compiler/rustc_parse/src/parser/path.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 7c2d8ba21a2..8f272820015 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -505,7 +505,9 @@ impl<'a> Parser<'a> { let span = ident.span.to(self.prev_token.span); let ty = match arg { Some(GenericArg::Type(ty)) => ty, - Some(GenericArg::Const(c)) => return Ok(AssocConstraintKind::ConstEquality { c }), + Some(GenericArg::Const(c)) => { + return Ok(AssocConstraintKind::Equality { term: c.into() }); + } Some(GenericArg::Lifetime(lt)) => { self.struct_span_err(span, "associated lifetimes are not supported") .span_label(lt.ident.span, "the lifetime is given here") @@ -540,7 +542,7 @@ impl<'a> Parser<'a> { return Err(err); } }; - Ok(AssocConstraintKind::Equality { ty }) + Ok(AssocConstraintKind::Equality { term: ty.into() }) } /// We do not permit arbitrary expressions as const arguments. They must be one of: -- cgit 1.4.1-3-g733a5