-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I get more information about "Should have a used entry for the template arg"? #2938
Comments
Could you provide a reproducer? It's a bug in bindgen. |
I have problem from large size closed source project. |
Getting more idea about the problem. clang version: Apple clang version 16.0.0 (clang-1600.0.26.3) I added When I use
When I give Using blocked type as other template type parameter seems to cause the problem |
And it is not that simple. input: t.hpp template<typename T>
class A {
T raw;
};
template<typename T>
class B {
T raw;
};
class X {
A<int> a;
B<int> b;
A<B<int> > c;
}; command: bindgen --blocklist-type 'B.*' t.hpp output: /* automatically generated by rust-bindgen 0.70.1 */
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct A<T> {
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
pub raw: T,
}
#[repr(C)]
pub struct X {
pub a: A<::std::os::raw::c_int>,
pub b: B<::std::os::raw::c_int>,
pub c: A<B<::std::os::raw::c_int>>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of X"][::std::mem::size_of::<X>() - 12usize];
["Alignment of X"][::std::mem::align_of::<X>() - 4usize];
["Offset of field: X::a"][::std::mem::offset_of!(X, a) - 0usize];
["Offset of field: X::b"][::std::mem::offset_of!(X, b) - 4usize];
["Offset of field: X::c"][::std::mem::offset_of!(X, c) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of template specialization: A_open0_int_close0"]
[::std::mem::size_of::<A<::std::os::raw::c_int>>() - 4usize];
["Align of template specialization: A_open0_int_close0"]
[::std::mem::align_of::<A<::std::os::raw::c_int>>() - 4usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of template specialization: A_open0_B_open1_int_close1_close0"]
[::std::mem::size_of::<A<B<::std::os::raw::c_int>>>() - 4usize];
["Align of template specialization: A_open0_B_open1_int_close1_close0"]
[::std::mem::align_of::<A<B<::std::os::raw::c_int>>>() - 4usize];
}; |
I encountered this panic after upgrading macOS SDK.
It seems to be related to new C++ headers of the SDK. I'd like to check the related types and adding them to blocklist types.
Could you advise how can I check the error causing type names?
Error messages:
Related code: https://github.com/rust-lang/rust-bindgen/blob/main/bindgen/ir/analysis/template_params.rs#L240-L263
The text was updated successfully, but these errors were encountered: