Rollup merge of #109914 - compiler-errors:rtn-bad-parens, r=oli-obk
Emit feature error for parenthesized generics in associated type bounds We don't actually do AST->HIR lowering with some `-Zunpretty` flags, so it's not correct to just delay a bug instead of emitting a feature error. Some diagnostics regressed because of the new errors, but oh well. 🤷 Fixes #109898
This commit is contained in:
commit
a5c395ed94
6 changed files with 64 additions and 12 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue