about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/path.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-03-05 01:08:17 +0000
committerMichael Goulet <michael@errs.io>2023-03-28 01:02:15 +0000
commit773e8a5ad1fa012bc1574c6733a700e094a48e3d (patch)
tree522700a419e0388d6ce179496ac564c1eb14bad6 /compiler/rustc_parse/src/parser/path.rs
parentfb9ca9223d42a13bc15bddd1c2dce506db2fcb21 (diff)
downloadrust-773e8a5ad1fa012bc1574c6733a700e094a48e3d.tar.gz
rust-773e8a5ad1fa012bc1574c6733a700e094a48e3d.zip
RTN
Diffstat (limited to 'compiler/rustc_parse/src/parser/path.rs')
-rw-r--r--compiler/rustc_parse/src/parser/path.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs
index b50d2984a4e..72f230e628d 100644
--- a/compiler/rustc_parse/src/parser/path.rs
+++ b/compiler/rustc_parse/src/parser/path.rs
@@ -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 };