Skip to content

cannot find type i32 in module std::os::raw #1025

@ctaggart

Description

@ctaggart

Input C/C++ Header

template <typename> class a {
  enum {};
};
template <typename> class b {};
namespace octave {
class c {
  b<a<char>> d;
};
}

Bindgen Invocation

~/rust-bindgen/target/debug/bindgen \
    --output __bindgen.rs \
    --enable-cxx-namespaces \
    --use-core \
    __bindgen.ii \
    -- -v -x c++ -std=c++11

Actual Results

How do I pretty print this on multiple lines like it used to?

/* automatically generated by rust-bindgen */

# [ allow ( non_snake_case , non_camel_case_types , non_upper_case_globals ) ] pub mod root { # [ allow ( unused_imports ) ] use self :: super :: root ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct a { pub _address : u8 , } pub type a__bindgen_ty_1 = :: std :: os :: raw :: i32 ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct b { pub _address : u8 , } pub mod octave { # [ allow ( unused_imports ) ] use self :: super :: super :: root ; # [ repr ( C ) ] # [ derive ( Debug , Copy ) ] pub struct c { pub d : root :: b , } # [ test ] fn bindgen_test_layout_c ( ) { assert_eq ! ( :: core :: mem :: size_of :: < c > ( ) , 1usize , concat ! ( "Size of: " , stringify ! ( c ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < c > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( c ) ) ) ; assert_eq ! ( unsafe { & ( * ( 0 as * const c ) ) . d as * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( c ) , "::" , stringify ! ( d ) ) ) ; } impl Clone for c { fn clone ( & self ) -> Self { * self } } } # [ test ] fn __bindgen_test_layout_b_open0_a_open1_char_close1_close0_instantiation ( ) { assert_eq ! ( :: core :: mem :: size_of :: < root :: b > ( ) , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( root :: b ) ) ) ; assert_eq ! ( :: core :: mem :: align_of :: < root :: b > ( ) , 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: b ) ) ) ; } }

Expected Results

Instead of

pub type a__bindgen_ty_1 = :: std :: os :: raw :: i32 ;

It would be

pub type a__bindgen_ty_1 = i32 ;

or

pub type a__bindgen_ty_1 = :: std :: os :: raw :: c_int ;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions