1
Fork 0

Emit feature error for parenthesized generics in associated type bounds

This commit is contained in:
Michael Goulet 2023-04-03 21:20:48 +00:00
parent 1767585509
commit ab0b9356e6
6 changed files with 64 additions and 12 deletions

View file

@ -485,17 +485,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
if let Some(args) = constraint.gen_args.as_ref()
&& matches!(
args,
ast::GenericArgs::ReturnTypeNotation(..) | ast::GenericArgs::Parenthesized(..)
ast::GenericArgs::ReturnTypeNotation(..)
)
{
// RTN is gated elsewhere, and parenthesized args will turn into
// another error.
if matches!(args, ast::GenericArgs::Parenthesized(..)) {
self.sess.delay_span_bug(
constraint.span,
"should have emitted a parenthesized generics error",
);
}
// RTN is gated below with a `gate_all`.
} else {
gate_feature_post!(
&self,