Lines Matching full:let
39 let mut path = parse_quote!(::zerocopy); in try_from_derive_input()
40 let mut skip_on_error = false; in try_from_derive_input()
41 let mut on_error_span = None; in try_from_derive_input()
44 if let Meta::List(ref meta_list) = attr.meta { in try_from_derive_input()
48 let expr = meta.value().and_then(|value| value.parse()); in try_from_derive_input()
49 if let Ok(Expr::Lit(ExprLit { lit: Lit::Str(lit), .. })) = expr { in try_from_derive_input()
50 if let Ok(path_lit) = lit.parse::<Ident>() { in try_from_derive_input()
64 let value = meta.value()?; in try_from_derive_input()
65 let s: LitStr = value.parse()?; in try_from_derive_input()
107 let zerocopy_crate = &self.zerocopy_crate; in core_path()
121 } else if let Some(span) = self.on_error_span { in cfg_compile_error()
122 let core = self.core_path(); in cfg_compile_error()
123 let error_message = in cfg_compile_error()
250 let s = t.to_string(); in to_ident_str()
251 if let Some(stripped) = s.strip_prefix("r#") { in to_ident_str()
279 let (trt, mcro) = match self { in validator_trait_and_macro_idents()
286 let trt = Ident::new(trt, Span::call_site()); in validator_trait_and_macro_idents()
287 let mcro = Ident::new(mcro, Span::call_site()); in validator_trait_and_macro_idents()
339 let s = match self { in to_tokens()
355 let ident = Ident::new(s, Span::call_site()); in to_tokens()
356 let arguments: Option<syn::AngleBracketedGenericArguments> = match self { in to_tokens()
382 let zerocopy_crate = &ctx.zerocopy_crate; in crate_path()
383 let core = ctx.core_path(); in crate_path()
548 let type_ident = &self.ctx.ast.ident; in build()
549 let trait_path = self.trt.crate_path(self.ctx); in build()
550 let fields = self.data.fields(); in build()
551 let variants = self.data.variants(); in build()
552 let tag = self.data.tag(); in build()
553 let zerocopy_crate = &self.ctx.zerocopy_crate; in build()
556 let traits = traits.map(|t| t.crate_path(ctx)); in build()
559 let field_type_bounds: Vec<_> = match (self.field_type_trait_bounds, &fields[..]) { in build()
573 let padding_check_bound = self in build()
580 let repr = in build()
582 let core = self.ctx.core_path(); in build()
583 let option = quote! { #core::option::Option }; in build()
584 let nonzero = quote! { #core::num::NonZeroUsize }; in build()
585 let none = quote! { #option::None::<#nonzero> }; in build()
586 let repr_align = in build()
588 let n = spanned.t.get(); in build()
591 let repr_packed = in build()
593 let n = packed.get(); in build()
596 let variant_types = variants.iter().map(|(_, fields)| { in build()
597 let types = fields.iter().map(|(_vis, _name, ty)| ty); in build()
600 let validator_context = check.validator_macro_context(); in build()
601 let (trt, validator_macro) = check.validator_trait_and_macro_idents(); in build()
602 let t = tag.iter(); in build()
614 let self_bounds: Option<WherePredicate> = match self.self_type_trait_bounds { in build()
621 let zerocopy_bounds = in build()
635 let bounds = self in build()
647 let mut params: Vec<_> = self in build()
675 let param_idents = self.ctx.ast.generics.params.iter().map(|param| match param { in build()
677 let ident = &ty.ident; in build()
681 let ident = &l.lifetime; in build()
685 let ident = &cnst.ident; in build()
690 let inner_extras = self.inner_extras; in build()
691 let allow_trivial_bounds = in build()
693 let impl_tokens = quote! { in build()
705 let outer_extras = self.outer_extras.filter(|e| !e.is_empty()); in build()
706 let cfg_compile_error = self.ctx.cfg_compile_error(); in build()
734 let items = items.into_iter().flatten(); in const_block()
761 let zerocopy_crate = &ctx.zerocopy_crate; in generate_tag_enum()
762 let variants = data.variants.iter().map(|v| { in generate_tag_enum()
763 let ident = &v.ident; in generate_tag_enum()
764 if let Some((eq, discriminant)) = &v.discriminant { in generate_tag_enum()
774 let repr = match repr { in generate_tag_enum()
841 let file = syn::parse2::<syn::File>(ts).expect("failed to parse generated output as File"); in check_hygiene()
849 let _ = <Self as Trait>::Item; in test_check_hygiene_success()
859 let _ = Self::Ambiguous; in test_check_hygiene_failure()