# Parenthesized impl Trait bound

fn produced() -> impl (Send) { loop {} }

==>

SourceFile(
  FunctionItem(
    fn,
    BoundIdentifier,
    ParamList,
    AbstractType(impl, ParenthesizedTraitBound(TypeIdentifier)),
    Block(ExpressionStatement(LoopExpression(loop, Block)))))

# Parenthesized generic and dyn bounds

fn consumed<T: (Send)>(value: &dyn (Send)) {}

==>

SourceFile(
  FunctionItem(
    fn,
    BoundIdentifier,
    TypeParamList(
      ConstrainedTypeParameter(
        TypeIdentifier,
        TraitBounds(ParenthesizedTraitBound(TypeIdentifier)))),
    ParamList(
      Parameter(
        BoundIdentifier,
        ReferenceType(
          DynamicType(dyn, ParenthesizedTraitBound(TypeIdentifier))))),
    Block))

# Parenthesized relaxed generic and where bounds

fn f<T: (?Sized), U>() where U: (?Sized) {}

==>

SourceFile(
  FunctionItem(
    fn,
    BoundIdentifier,
    TypeParamList(
      ConstrainedTypeParameter(
        TypeIdentifier,
        TraitBounds(ParenthesizedTraitBound(RemovedTraitBound(TypeIdentifier)))),
      TypeIdentifier),
    ParamList,
    WhereClause(
      where,
      TypeBoundClause(
        TypeIdentifier,
        TraitBounds(ParenthesizedTraitBound(RemovedTraitBound(TypeIdentifier))))),
    Block))

# Parenthesized relaxed associated type bound

trait A { type Item: (?Sized); }

==>

SourceFile(
  TraitItem(
    trait,
    TypeIdentifier,
    DeclarationList(
      AssociatedType(
        type,
        TypeIdentifier,
        TraitBounds(ParenthesizedTraitBound(RemovedTraitBound(TypeIdentifier)))))))

# Parenthesized bound after dyn Trait

type A = dyn Send + (Sync);

==>

SourceFile(
  TypeItem(
    type,
    TypeIdentifier,
    BoundedType(DynamicType(dyn, TypeIdentifier), ParenthesizedTraitBound(TypeIdentifier))))

# Parenthesized higher-ranked bound after dyn Trait

type A = dyn Send + (for<'a> Fn(&'a str));

==>

SourceFile(
  TypeItem(
    type,
    TypeIdentifier,
    BoundedType(
      DynamicType(dyn, TypeIdentifier),
      ParenthesizedTraitBound(
        HigherRankedTraitBound(
          for,
          TypeParamList(Lifetime),
          FunctionType(
            TypeIdentifier,
            ParamList(Parameter(ReferenceType(Lifetime, TypeIdentifier)))))))))
