about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/path.rs
diff options
context:
space:
mode:
authorkadmin <julianknodt@gmail.com>2022-01-07 03:58:32 +0000
committerkadmin <julianknodt@gmail.com>2022-01-17 17:20:57 +0000
commitfb57b7518d207caa99bdd99f4dab2a7d3902a83a (patch)
tree3e34269c3e145261eba9288f049b06c9a6c6b183 /compiler/rustc_parse/src/parser/path.rs
parent07659996221446273065651ff9c0fcb00935eb03 (diff)
downloadrust-fb57b7518d207caa99bdd99f4dab2a7d3902a83a.tar.gz
rust-fb57b7518d207caa99bdd99f4dab2a7d3902a83a.zip
Add term
Instead of having a separate enum variant for types and consts have one but have either a const
or type.
Diffstat (limited to 'compiler/rustc_parse/src/parser/path.rs')
-rw-r--r--compiler/rustc_parse/src/parser/path.rs6
1 files changed, 4 insertions, 2 deletions
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: