@@ -3,7 +3,7 @@ mod error;
3
3
mod helpers;
4
4
pub mod struct_layout;
5
5
6
- use self :: helpers:: { BlobTyBuilder , attributes} ;
6
+ use self :: helpers:: attributes;
7
7
use self :: struct_layout:: StructLayoutTracker ;
8
8
9
9
use aster;
@@ -1155,7 +1155,7 @@ impl Bitfield {
1155
1155
let bitfield_ty_layout = bitfield_ty. layout ( ctx) . expect (
1156
1156
"Bitfield without layout? Gah!" ,
1157
1157
) ;
1158
- let bitfield_int_ty = BlobTyBuilder :: new ( bitfield_ty_layout) . build ( ) ;
1158
+ let bitfield_int_ty = helpers :: blob ( bitfield_ty_layout) ;
1159
1159
let bitfield_ty =
1160
1160
bitfield_ty. to_rust_ty_or_opaque ( ctx, bitfield_ty_item) ;
1161
1161
@@ -1205,7 +1205,7 @@ impl<'a> FieldCodegen<'a> for BitfieldUnit {
1205
1205
F : Extend < ast:: StructField > ,
1206
1206
M : Extend < ast:: ImplItem > ,
1207
1207
{
1208
- let field_ty = BlobTyBuilder :: new ( self . layout ( ) ) . build ( ) ;
1208
+ let field_ty = helpers :: blob ( self . layout ( ) ) ;
1209
1209
let unit_field_name = format ! ( "_bitfield_{}" , self . nth( ) ) ;
1210
1210
1211
1211
let field = StructFieldBuilder :: named ( & unit_field_name)
@@ -1355,7 +1355,7 @@ impl<'a> FieldCodegen<'a> for Bitfield {
1355
1355
let bitfield_ty_layout = bitfield_ty. layout ( ctx) . expect (
1356
1356
"Bitfield without layout? Gah!" ,
1357
1357
) ;
1358
- let bitfield_int_ty = BlobTyBuilder :: new ( bitfield_ty_layout) . build ( ) ;
1358
+ let bitfield_int_ty = helpers :: blob ( bitfield_ty_layout) ;
1359
1359
1360
1360
let bitfield_ty =
1361
1361
bitfield_ty. to_rust_ty_or_opaque ( ctx, bitfield_ty_item) ;
@@ -1639,7 +1639,7 @@ impl CodeGenerator for CompInfo {
1639
1639
1640
1640
if is_union {
1641
1641
let layout = layout. expect ( "Unable to get layout information?" ) ;
1642
- let ty = BlobTyBuilder :: new ( layout) . build ( ) ;
1642
+ let ty = helpers :: blob ( layout) ;
1643
1643
1644
1644
let field = if self . can_be_rust_union ( ctx) {
1645
1645
StructFieldBuilder :: named ( "_bindgen_union_align" ) . build_ty ( ty)
@@ -1662,7 +1662,7 @@ impl CodeGenerator for CompInfo {
1662
1662
1663
1663
match layout {
1664
1664
Some ( l) => {
1665
- let ty = BlobTyBuilder :: new ( l ) . build ( ) ;
1665
+ let ty = helpers :: blob ( l ) ;
1666
1666
let field = StructFieldBuilder :: named (
1667
1667
"_bindgen_opaque_blob" ,
1668
1668
) . pub_ ( )
@@ -1707,7 +1707,7 @@ impl CodeGenerator for CompInfo {
1707
1707
} ;
1708
1708
1709
1709
if has_address {
1710
- let ty = BlobTyBuilder :: new ( Layout :: new ( 1 , 1 ) ) . build ( ) ;
1710
+ let ty = helpers :: blob ( Layout :: new ( 1 , 1 ) ) ;
1711
1711
let field =
1712
1712
StructFieldBuilder :: named ( "_address" ) . pub_ ( ) . build_ty ( ty) ;
1713
1713
fields. push ( field) ;
@@ -2728,7 +2728,7 @@ trait TryToOpaque {
2728
2728
extra : & Self :: Extra ,
2729
2729
) -> error:: Result < P < ast:: Ty > > {
2730
2730
self . try_get_layout ( ctx, extra) . map ( |layout| {
2731
- BlobTyBuilder :: new ( layout) . build ( )
2731
+ helpers :: blob ( layout)
2732
2732
} )
2733
2733
}
2734
2734
}
@@ -2756,7 +2756,7 @@ trait ToOpaque: TryToOpaque {
2756
2756
extra : & Self :: Extra ,
2757
2757
) -> P < ast:: Ty > {
2758
2758
let layout = self . get_layout ( ctx, extra) ;
2759
- BlobTyBuilder :: new ( layout) . build ( )
2759
+ helpers :: blob ( layout)
2760
2760
}
2761
2761
}
2762
2762
@@ -2814,7 +2814,7 @@ where
2814
2814
|_| if let Ok ( layout) =
2815
2815
self . try_get_layout ( ctx, extra)
2816
2816
{
2817
- Ok ( BlobTyBuilder :: new ( layout) . build ( ) )
2817
+ Ok ( helpers :: blob ( layout) )
2818
2818
} else {
2819
2819
Err ( error:: Error :: NoLayoutForOpaqueBlob )
2820
2820
} ,
0 commit comments