File tree 3 files changed +6
-0
lines changed
3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 238
238
- Add option to use DST structs for flexible arrays (--flexarray-dst, #2772 ).
239
239
- Add option to dynamically load variables (#2812 ).
240
240
- Add option in CLI to use rustified non-exhaustive enums (--rustified-non-exhaustive-enum, #2847 ).
241
+ - Add field_type_name to FieldInfo.
241
242
## Changed
242
243
- Remove which and lazy-static dependencies (#2809 , #2817 ).
243
244
- Generate compile-time layout tests (#2787 ).
Original file line number Diff line number Diff line change @@ -280,4 +280,6 @@ pub struct FieldInfo<'a> {
280
280
pub type_name : & ' a str ,
281
281
/// The name of the field.
282
282
pub field_name : & ' a str ,
283
+ /// The name of the type of the field.
284
+ pub field_type_name : Option < & ' a str > ,
283
285
}
Original file line number Diff line number Diff line change @@ -1547,6 +1547,7 @@ impl FieldCodegen<'_> for FieldData {
1547
1547
cb. field_visibility ( FieldInfo {
1548
1548
type_name : & parent_item. canonical_name ( ctx) ,
1549
1549
field_name,
1550
+ field_type_name : field_ty. name ( ) ,
1550
1551
} )
1551
1552
} ) ,
1552
1553
self . annotations ( ) ,
@@ -1952,6 +1953,7 @@ impl<'a> FieldCodegen<'a> for Bitfield {
1952
1953
1953
1954
let bitfield_ty_item = ctx. resolve_item ( self . ty ( ) ) ;
1954
1955
let bitfield_ty = bitfield_ty_item. expect_type ( ) ;
1956
+ let bitfield_ty_ident = bitfield_ty. name ( ) ;
1955
1957
1956
1958
let bitfield_ty_layout = bitfield_ty
1957
1959
. layout ( ctx)
@@ -1976,6 +1978,7 @@ impl<'a> FieldCodegen<'a> for Bitfield {
1976
1978
cb. field_visibility ( FieldInfo {
1977
1979
type_name : & parent_item. canonical_name ( ctx) ,
1978
1980
field_name,
1981
+ field_type_name : bitfield_ty_ident,
1979
1982
} )
1980
1983
} )
1981
1984
} ) ;
You can’t perform that action at this time.
0 commit comments