-
Notifications
You must be signed in to change notification settings - Fork 742
the trait bound [u8; 44]: std::default::Default
is not satisfied
#1718
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
Comments
How does the struct look like? This should be pretty easy to reduce. |
The error arises for timex struct from linux headers #[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct timex {
pub modes: ::std::os::raw::c_uint,
pub offset: __syscall_slong_t,
pub freq: __syscall_slong_t,
pub maxerror: __syscall_slong_t,
pub esterror: __syscall_slong_t,
pub status: ::std::os::raw::c_int,
pub constant: __syscall_slong_t,
pub precision: __syscall_slong_t,
pub tolerance: __syscall_slong_t,
pub time: timeval,
pub tick: __syscall_slong_t,
pub ppsfreq: __syscall_slong_t,
pub jitter: __syscall_slong_t,
pub shift: ::std::os::raw::c_int,
pub stabil: __syscall_slong_t,
pub jitcnt: __syscall_slong_t,
pub calcnt: __syscall_slong_t,
pub errcnt: __syscall_slong_t,
pub stbcnt: __syscall_slong_t,
pub tai: ::std::os::raw::c_int,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 44usize], u8>,
}
impl timex {
#[inline]
pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 44usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 44usize], u8> =
Default::default();
__bindgen_bitfield_unit
}
} |
Ok, so at least on my machine that looks like this:
Does that match your machine? |
Ok, so this does repro the issue:
A workaround for now could be to blacklist / mark |
I opaqued |
By not generating various code for it. In the future, we could improve on this by splitting contiguous bitfield units, if needed, so that we can implement them without dealing with rust array derive limits. Fixes rust-lang#1718
#1719 has a fix. |
also, one could hope that rust would get const generics one of these days, so we can stop hacking around the 32-bit size limit in arrays... ;( |
By not generating various code for it. In the future, we could improve on this by splitting contiguous bitfield units, if needed, so that we can implement them without dealing with rust array derive limits. Fixes #1718
I change the bindgen version from
0.30.0
to0.52.0
in nginx crate.Header
Bindgen Invocation
Actual Results
Expected Results
The crate is successfully built using
v0.30.0
of bindgen, however an update to bindgen version causes the problem. I triedderive_default(true)
with no success.The text was updated successfully, but these errors were encountered: