@@ -485,20 +485,23 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
485
485
486
486
fn visit_assoc_constraint ( & mut self , constraint : & ' a AssocConstraint ) {
487
487
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 ( ..) )
493
491
{
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
+ ) ;
495
498
} else {
496
499
gate_feature_post ! (
497
500
& self ,
498
501
associated_type_bounds,
499
502
constraint. span,
500
503
"associated type bounds are unstable"
501
- )
504
+ ) ;
502
505
}
503
506
}
504
507
visit:: walk_assoc_constraint ( self , constraint)
@@ -589,7 +592,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
589
592
gate_all ! ( yeet_expr, "`do yeet` expression is experimental" ) ;
590
593
gate_all ! ( dyn_star, "`dyn*` trait objects are experimental" ) ;
591
594
gate_all ! ( const_closures, "const closures are experimental" ) ;
592
- gate_all ! ( return_type_notation, "return type notation is experimental" ) ;
593
595
594
596
// All uses of `gate_all!` below this point were added in #65742,
595
597
// and subsequently disabled (with the non-early gating readded).
@@ -605,6 +607,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
605
607
606
608
gate_all ! ( trait_alias, "trait aliases are experimental" ) ;
607
609
gate_all ! ( associated_type_bounds, "associated type bounds are unstable" ) ;
610
+ gate_all ! ( return_type_notation, "return type notation is experimental" ) ;
608
611
gate_all ! ( decl_macro, "`macro` is experimental" ) ;
609
612
gate_all ! ( box_patterns, "box pattern syntax is experimental" ) ;
610
613
gate_all ! ( exclusive_range_pattern, "exclusive range pattern syntax is experimental" ) ;
0 commit comments