@@ -485,20 +485,23 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
485485
486486 fn visit_assoc_constraint ( & mut self , constraint : & ' a AssocConstraint ) {
487487 if let AssocConstraintKind :: Bound { .. } = constraint. kind {
488- if let Some ( args) = constraint. gen_args . as_ref ( )
489- && matches ! (
490- args,
491- ast:: GenericArgs :: ReturnTypeNotation ( ..)
492- )
488+ if let Some ( ast:: GenericArgs :: Parenthesized ( args) ) = constraint. gen_args . as_ref ( )
489+ && args. inputs . is_empty ( )
490+ && matches ! ( args. output, ast:: FnRetTy :: Default ( ..) )
493491 {
494- // RTN is gated below with a `gate_all`.
492+ gate_feature_post ! (
493+ & self ,
494+ return_type_notation,
495+ constraint. span,
496+ "return type notation is experimental"
497+ ) ;
495498 } else {
496499 gate_feature_post ! (
497500 & self ,
498501 associated_type_bounds,
499502 constraint. span,
500503 "associated type bounds are unstable"
501- )
504+ ) ;
502505 }
503506 }
504507 visit:: walk_assoc_constraint ( self , constraint)
@@ -589,7 +592,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
589592 gate_all ! ( yeet_expr, "`do yeet` expression is experimental" ) ;
590593 gate_all ! ( dyn_star, "`dyn*` trait objects are experimental" ) ;
591594 gate_all ! ( const_closures, "const closures are experimental" ) ;
592- gate_all ! ( return_type_notation, "return type notation is experimental" ) ;
593595
594596 // All uses of `gate_all!` below this point were added in #65742,
595597 // and subsequently disabled (with the non-early gating readded).
@@ -605,6 +607,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
605607
606608 gate_all ! ( trait_alias, "trait aliases are experimental" ) ;
607609 gate_all ! ( associated_type_bounds, "associated type bounds are unstable" ) ;
610+ gate_all ! ( return_type_notation, "return type notation is experimental" ) ;
608611 gate_all ! ( decl_macro, "`macro` is experimental" ) ;
609612 gate_all ! ( box_patterns, "box pattern syntax is experimental" ) ;
610613 gate_all ! ( exclusive_range_pattern, "exclusive range pattern syntax is experimental" ) ;
0 commit comments