You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to generate bindings for a bigger file I encountered a Rust-compile error when compiling the binding code.
The generated code generally looks good, the only problem is that a type parameter for a generated struct is not applied.
Inside a template class I defined two inner-classes. Since the template parameters applies to inner items as well, the inner classes are not explicitly parameterized.
The problem occurs when one inner class inherits the other (which makes use of the template arg).
/* automatically generated by rust-bindgen */#[repr(C)]#[derive(Debug,Copy,Clone)]pubstructThing{pub_address:u8,}#[repr(C)]#[derive(Debug,Copy,Clone)]pubstructThing_Inner<T>{pubptr:*mutT,pub_phantom_0:::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,}#[repr(C)]#[derive(Debug,Copy,Clone)]pubstructThing_AnotherInner<T>{pub_base:Thing_Inner,pub_phantom_0:::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,}
Compile error:
error[E0107]: wrong number of type arguments: expected 1, found 0
--> ...project/target/debug/build/the-project-8f7347729392ec63/out/bindings.rs:17:16
|
17 | pub _base: Thing_Inner,
| ^^^^^^^^^^^ expected 1 type argument
error: aborting due to previous error
Expected Results
The field _base of the Thing_AnotherInner should have the type parameter applied.
When manually changing line 17 to pub _base: Thing_Inner<T>, it compiles fine.
The text was updated successfully, but these errors were encountered:
While trying to generate bindings for a bigger file I encountered a Rust-compile error when compiling the binding code.
The generated code generally looks good, the only problem is that a type parameter for a generated struct is not applied.
Inside a template class I defined two inner-classes. Since the template parameters applies to inner items as well, the inner classes are not explicitly parameterized.
The problem occurs when one inner class inherits the other (which makes use of the template arg).
Input C/C++ Header
Bindgen Invocation
Actual Results
Compile error:
Expected Results
The field
_base
of theThing_AnotherInner
should have the type parameter applied.When manually changing line 17 to
pub _base: Thing_Inner<T>,
it compiles fine.The text was updated successfully, but these errors were encountered: