@@ -527,7 +527,7 @@ impl<'a> Parser<'a> {
527
527
Ok ( ident_gen_args) => ident_gen_args,
528
528
Err ( ( ) ) => return Ok ( Some ( AngleBracketedArg :: Arg ( arg) ) ) ,
529
529
} ;
530
- if binder. is_some ( ) {
530
+ if binder {
531
531
// FIXME(compiler-errors): this could be improved by suggesting lifting
532
532
// this up to the trait, at least before this becomes real syntax.
533
533
// e.g. `Trait<for<'a> Assoc = Ty>` -> `for<'a> Trait<Assoc = Ty>`
@@ -720,28 +720,24 @@ impl<'a> Parser<'a> {
720
720
721
721
/// Given a arg inside of generics, we try to destructure it as if it were the LHS in
722
722
/// `LHS = ...`, i.e. an associated type binding.
723
- /// This returns (optionally, if they are present) any `for<'a, 'b>` binder args, the
723
+ /// This returns a bool indicating if there are any `for<'a, 'b>` binder args, the
724
724
/// identifier, and any GAT arguments.
725
725
fn get_ident_from_generic_arg (
726
726
& self ,
727
727
gen_arg : & GenericArg ,
728
- ) -> Result < ( Option < Vec < ast :: GenericParam > > , Ident , Option < GenericArgs > ) , ( ) > {
728
+ ) -> Result < ( bool , Ident , Option < GenericArgs > ) , ( ) > {
729
729
if let GenericArg :: Type ( ty) = gen_arg {
730
730
if let ast:: TyKind :: Path ( qself, path) = & ty. kind
731
731
&& qself. is_none ( )
732
732
&& let [ seg] = path. segments . as_slice ( )
733
733
{
734
- return Ok ( ( None , seg. ident , seg. args . as_deref ( ) . cloned ( ) ) ) ;
734
+ return Ok ( ( false , seg. ident , seg. args . as_deref ( ) . cloned ( ) ) ) ;
735
735
} else if let ast:: TyKind :: TraitObject ( bounds, ast:: TraitObjectSyntax :: None ) = & ty. kind
736
736
&& let [ ast:: GenericBound :: Trait ( trait_ref, ast:: TraitBoundModifier :: None ) ] =
737
737
bounds. as_slice ( )
738
738
&& let [ seg] = trait_ref. trait_ref . path . segments . as_slice ( )
739
739
{
740
- return Ok ( (
741
- Some ( trait_ref. bound_generic_params . clone ( ) ) ,
742
- seg. ident ,
743
- seg. args . as_deref ( ) . cloned ( ) ,
744
- ) ) ;
740
+ return Ok ( ( true , seg. ident , seg. args . as_deref ( ) . cloned ( ) ) ) ;
745
741
}
746
742
}
747
743
Err ( ( ) )
0 commit comments