This commit is contained in:
Michael Goulet 2023-03-05 01:08:17 +00:00
parent fb9ca9223d
commit 773e8a5ad1
3 changed files with 120 additions and 51 deletions

View file

@ -550,7 +550,11 @@ impl<'a> Parser<'a> {
// Gate associated type bounds, e.g., `Iterator<Item: Ord>`.
if let AssocConstraintKind::Bound { .. } = kind {
self.sess.gated_spans.gate(sym::associated_type_bounds, span);
if gen_args.as_ref().map_or(false, |args| args.is_parenthesized()) {
self.sess.gated_spans.gate(sym::return_type_notation, span);
} else {
self.sess.gated_spans.gate(sym::associated_type_bounds, span);
}
}
let constraint =
AssocConstraint { id: ast::DUMMY_NODE_ID, ident, gen_args, kind, span };