• Home
  • Raw
  • Download

Lines Matching full:arbitrary

12 static ARBITRARY_ATTRIBUTE_NAME: &str = "arbitrary";
13 static ARBITRARY_LIFETIME_NAME: &str = "'arbitrary";
15 #[proc_macro_derive(Arbitrary, attributes(arbitrary))]
64 …impl #impl_generics arbitrary::Arbitrary<#lifetime_without_bounds> for #name #ty_generics #where_c… in expand_derive_arbitrary()
73 // Example: ("'arbitrary", "'arbitrary: 'a + 'b")
130 // Otherwise, inject a `T: Arbitrary` bound for every parameter. in apply_trait_bounds()
135 // Add a bound `T: Arbitrary` to every type parameter T.
141 .push(parse_quote!(arbitrary::Arbitrary<#lifetime>)); in add_trait_bounds()
156 return Err(arbitrary::Error::NotEnoughData); in with_recursive_count_guard()
186 let arbitrary = construct(fields, |_idx, field| gen_constructor_for_field(field))?; in gen_arbitrary_method() localVariable
187 let body = with_recursive_count_guard(recursive_count, quote! { Ok(#ident #arbitrary) }); in gen_arbitrary_method()
194 fn arbitrary(u: &mut arbitrary::Unstructured<#lifetime>) -> arbitrary::Result<Self> { in gen_arbitrary_method()
198 … fn arbitrary_take_rest(mut u: arbitrary::Unstructured<#lifetime>) -> arbitrary::Result<Self> { in gen_arbitrary_method()
240 let arbitrary = with_recursive_count_guard( in gen_arbitrary_method() localVariable
246 … Ok(match (u64::from(<u32 as arbitrary::Arbitrary>::arbitrary(u)?) * #count) >> 32 { in gen_arbitrary_method()
259 … Ok(match (u64::from(<u32 as arbitrary::Arbitrary>::arbitrary(&mut u)?) * #count) >> 32 { in gen_arbitrary_method()
267 … fn arbitrary(u: &mut arbitrary::Unstructured<#lifetime>) -> arbitrary::Result<Self> { in gen_arbitrary_method()
268 #arbitrary in gen_arbitrary_method()
271 … fn arbitrary_take_rest(mut u: arbitrary::Unstructured<#lifetime>) -> arbitrary::Result<Self> { in gen_arbitrary_method()
315 FieldConstructor::Arbitrary => { in construct_take_rest()
317 quote! { arbitrary::Arbitrary::arbitrary_take_rest(u)? } in construct_take_rest()
319 quote! { arbitrary::Arbitrary::arbitrary(&mut u)? } in construct_take_rest()
339 FieldConstructor::Arbitrary => { in gen_size_hint_method()
340 quote! { <#ty as arbitrary::Arbitrary>::size_hint(depth) } in gen_size_hint_method()
355 arbitrary::size_hint::and_all(&[ in gen_size_hint_method()
366 arbitrary::size_hint::recursion_guard(depth, |depth| #hint) in gen_size_hint_method()
383 arbitrary::size_hint::and( in gen_size_hint_method()
384 <u32 as arbitrary::Arbitrary>::size_hint(depth), in gen_size_hint_method()
385 arbitrary::size_hint::recursion_guard(depth, |depth| { in gen_size_hint_method()
386 arbitrary::size_hint::or_all(&[ #( #variants ),* ]) in gen_size_hint_method()
398 FieldConstructor::Arbitrary => quote!(arbitrary::Arbitrary::arbitrary(u)?), in gen_constructor_for_field()