Add term
Instead of having a separate enum variant for types and consts have one but have either a const or type.
This commit is contained in:
parent
0765999622
commit
fb57b7518d
11 changed files with 68 additions and 37 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue