2022-03-10 09:53:48 -06:00
// ignore-tidy-linelength
2024-07-19 09:50:47 -05:00
//@ set foo = "$.index[*][?(@.name=='Foo')].id"
2022-03-10 09:53:48 -06:00
pub trait Foo { }
2024-07-19 09:50:47 -05:00
//@ set generic_foo = "$.index[*][?(@.name=='GenericFoo')].id"
2022-05-04 13:49:05 -05:00
pub trait GenericFoo < ' a > { }
2024-07-19 09:50:47 -05:00
//@ is "$.index[*][?(@.name=='generics')].inner.function.generics.where_predicates" "[]"
//@ count "$.index[*][?(@.name=='generics')].inner.function.generics.params[*]" 1
//@ is "$.index[*][?(@.name=='generics')].inner.function.generics.params[0].name" '"F"'
//@ is "$.index[*][?(@.name=='generics')].inner.function.generics.params[0].kind.type.default" 'null'
//@ count "$.index[*][?(@.name=='generics')].inner.function.generics.params[0].kind.type.bounds[*]" 1
//@ is "$.index[*][?(@.name=='generics')].inner.function.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" '$foo'
2024-08-04 18:44:35 -05:00
//@ count "$.index[*][?(@.name=='generics')].inner.function.sig.inputs[*]" 1
//@ is "$.index[*][?(@.name=='generics')].inner.function.sig.inputs[0][0]" '"f"'
//@ is "$.index[*][?(@.name=='generics')].inner.function.sig.inputs[0][1].generic" '"F"'
2022-03-10 09:53:48 -06:00
pub fn generics < F : Foo > ( f : F ) { }
2024-07-19 09:50:47 -05:00
//@ is "$.index[*][?(@.name=='impl_trait')].inner.function.generics.where_predicates" "[]"
//@ count "$.index[*][?(@.name=='impl_trait')].inner.function.generics.params[*]" 1
//@ is "$.index[*][?(@.name=='impl_trait')].inner.function.generics.params[0].name" '"impl Foo"'
//@ is "$.index[*][?(@.name=='impl_trait')].inner.function.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" $foo
2024-08-04 18:44:35 -05:00
//@ count "$.index[*][?(@.name=='impl_trait')].inner.function.sig.inputs[*]" 1
//@ is "$.index[*][?(@.name=='impl_trait')].inner.function.sig.inputs[0][0]" '"f"'
//@ count "$.index[*][?(@.name=='impl_trait')].inner.function.sig.inputs[0][1].impl_trait[*]" 1
//@ is "$.index[*][?(@.name=='impl_trait')].inner.function.sig.inputs[0][1].impl_trait[0].trait_bound.trait.id" $foo
2022-03-10 09:53:48 -06:00
pub fn impl_trait ( f : impl Foo ) { }
2024-07-19 09:50:47 -05:00
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.generics.params[*]" 3
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.params[0].name" '"F"'
2024-08-04 18:44:35 -05:00
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.params[0].kind" '{"type": {"bounds": [], "default": null, "is_synthetic": false}}'
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.sig.inputs[*]" 3
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.sig.inputs[0][0]" '"f"'
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.sig.inputs[0][1].generic" '"F"'
2024-07-19 09:50:47 -05:00
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[*]" 3
2022-05-04 13:49:05 -05:00
2024-07-19 09:50:47 -05:00
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[0].bound_predicate.type.generic" \"F\"
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[0].bound_predicate.bounds[*]" 1
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[0].bound_predicate.bounds[0].trait_bound.trait.id" $foo
2022-05-04 13:49:05 -05:00
2024-07-19 09:50:47 -05:00
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[1].bound_predicate.type.generic" \"G\"
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[1].bound_predicate.bounds[*]" 1
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.trait.id" $generic_foo
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[*]" 1
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[0].name" \"\'a\"
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[0].kind.lifetime.outlives" "[]"
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[1].bound_predicate.generic_params" "[]"
2022-05-04 13:49:05 -05:00
2024-07-19 09:50:47 -05:00
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.type.borrowed_ref.lifetime" \"\'b\"
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.type.borrowed_ref.type.generic" \"H\"
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.bounds[*]" 1
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.bounds[0].trait_bound.trait.id" $foo
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.bounds[0].trait_bound.generic_params" "[]"
//@ count "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.generic_params[*]" 1
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.generic_params[0].name" \"\'b\"
//@ is "$.index[*][?(@.name=='where_clase')].inner.function.generics.where_predicates[2].bound_predicate.generic_params[0].kind.lifetime.outlives" "[]"
2022-05-04 13:49:05 -05:00
pub fn where_clase < F , G , H > ( f : F , g : G , h : H )
2022-03-10 09:53:48 -06:00
where
F : Foo ,
2022-05-04 13:49:05 -05:00
G : for < ' a > GenericFoo < ' a > ,
for < ' b > & ' b H : Foo ,
2022-03-10 09:53:48 -06:00
{
}