File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,10 @@ WellKnownTrait: WellKnownTrait = {
59
59
"#" "[" "lang" "(" "unsize" ")" "]" => WellKnownTrait::Unsize,
60
60
};
61
61
62
- StructReprC: () = "#" "[" "repr(C)" "]";
63
- StructReprPacked: () = "#" "[" "repr(packed)" "]";
62
+ StructRepr: Atom = "#" "[" "repr" "(" <name:Id> ")" "]" => name.str;
64
63
65
64
StructDefn: StructDefn = {
66
- <upstream:UpstreamKeyword?> <fundamental:FundamentalKeyword?> <phantom_data:PhantomDataKeyword?> <repr_c:StructReprC?> <repr_packed:StructReprPacked? >
65
+ <upstream:UpstreamKeyword?> <fundamental:FundamentalKeyword?> <phantom_data:PhantomDataKeyword?> <repr:StructRepr* >
67
66
"struct" <n:Id><p:Angle<VariableKind>>
68
67
<w:QuantifiedWhereClauses> "{" <f:Fields> "}" => StructDefn
69
68
{
@@ -77,8 +76,8 @@ StructDefn: StructDefn = {
77
76
phantom_data: phantom_data.is_some(),
78
77
},
79
78
repr: StructRepr {
80
- repr_c: repr_c.is_some( ),
81
- repr_packed: repr_packed.is_some( ),
79
+ repr_c: repr.iter().any(|s| s == "C" ),
80
+ repr_packed: repr.iter().any(|s| s == "packed" ),
82
81
},
83
82
}
84
83
};
You can’t perform that action at this time.
0 commit comments