Lines Matching full:fields

7     Expr, Fields, Ident, Index, Type,
70 /// `repr(C)` tuple structs with the same fields as the variant after a
74 /// we use a "fused" representation with fields for both an inner tag and an
94 if matches!(variant.fields, Fields::Unit) { in generate_variant_structs()
99 let field_types = variant.fields.iter().map(|f| &f.ty); in generate_variant_structs()
137 let fields = data.variants.iter().filter_map(|variant| { in generate_variants_union() localVariable
140 if matches!(variant.fields, Fields::Unit) { in generate_variants_union()
156 #(#fields)* in generate_variants_union()
157 // Enums can have variants with no fields, but unions must in generate_variants_union()
180 /// corresponding discriminants as the original enum, but without any fields
185 /// 3. Generate variant structs. These are structs which have the same fields as
194 /// - `repr(C)`: <https://doc.rust-lang.org/reference/type-layout.html#reprc-enums-with-fields>
195 …https://doc.rust-lang.org/reference/type-layout.html#primitive-representation-of-enums-with-fields>
196 ….org/reference/type-layout.html#combining-primitive-representations-of-enums-with-fields-and-reprc>
229 let has_fields = data.variants().into_iter().flat_map(|(variant, fields)| { in derive_is_bit_valid()
233 fields.into_iter().enumerate().map(move |(idx, (vis, ident, ty))| { in derive_is_bit_valid()
235 // enum fields, but we guard against the possibility to ensure this in derive_is_bit_valid()
243 // modifiers on enum fields, any public type is suitable here; in derive_is_bit_valid()
278 // modifiers on enum fields, any public type is suitable in derive_is_bit_valid()
309 if matches!(variant.fields, Fields::Unit) { in derive_is_bit_valid()
454 let fields = ctx.ast.data.fields(); in derive_has_field_struct_union() localVariable
455 if fields.is_empty() { in derive_has_field_struct_union()
459 let field_tokens = fields.iter().map(|(vis, ident, _)| { in derive_has_field_struct_union()
489 let has_fields = fields.iter().map(move |(_, ident, ty)| { in derive_has_field_struct_union()
550 // `Initialized`, so too is the validity of its fields. in derive_has_field_struct_union()
569 let fields = strct.fields(); in derive_try_from_bytes_struct() localVariable
570 let field_names = fields.iter().map(|(_vis, name, _ty)| name); in derive_try_from_bytes_struct()
571 let field_tys = fields.iter().map(|(_vis, _name, ty)| ty); in derive_try_from_bytes_struct()
577 // validities of its fields, so this is a sound implementation in derive_try_from_bytes_struct()
617 let fields = unn.fields(); in derive_try_from_bytes_union() localVariable
618 let field_names = fields.iter().map(|(_vis, name, _ty)| name); in derive_try_from_bytes_union()
619 let field_tys = fields.iter().map(|(_vis, _name, ty)| ty); in derive_try_from_bytes_union()
671 // If an enum has no fields, it has a well-defined integer representation, in derive_try_from_bytes_enum()
677 .map(|size| enm.fields().is_empty() && enm.variants.len() == 1usize << size) in derive_try_from_bytes_enum()