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
--> /.../out/bindings.rs:39:20
|
39 | let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
warning[E0133]: dereference of raw pointer is unsafe and requires unsafe block
--> /.../out/bindings.rs:64:34
|
64 | *byte = Self::change_bit(*byte, index, val);
| ^^^^^ dereference of raw pointer
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
Generated code (getter):
#[inline]pubunsafefnraw_get(this:*constSelf,bit_offset:usize,bit_width:u8) -> u64{debug_assert!(bit_width <= 64);debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());debug_assert!((bit_offset + (bit_width asusize)) / 8 <= core::mem::size_of::<Storage>());letmut val = 0;for i in0..(bit_width asusize){ifSelf::raw_get_bit(this, i + bit_offset){let index = ifcfg!(target_endian = "big"){
bit_width asusize - 1 - i
}else{
i
};
val |= 1 << index;}}
val
}
Warning:
warning[E0133]: call to unsafe function `__BindgenBitfieldUnit::<Storage>::raw_get_bit` is unsafe and requires unsafe block
--> /.../out/bindings.rs:91:16
|
91 | if Self::raw_get_bit(this, i + bit_offset) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
= note: consult the function's documentation for information on how to avoid undefined behavior
Generated code (setter):
#[inline]pubunsafefnraw_set(this:*mutSelf,bit_offset:usize,bit_width:u8,val:u64){debug_assert!(bit_width <= 64);debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());debug_assert!((bit_offset + (bit_width asusize)) / 8 <= core::mem::size_of::<Storage>());for i in0..(bit_width asusize){let mask = 1 << i;let val_bit_is_set = val & mask == mask;let index = ifcfg!(target_endian = "big"){
bit_width asusize - 1 - i
}else{
i
};Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);}}
Warning:
warning[E0133]: call to unsafe function `__BindgenBitfieldUnit::<Storage>::raw_set_bit` is unsafe and requires unsafe block
--> /.../out/bindings.rs:131:13
|
131 | Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
= note: consult the function's documentation for information on how to avoid undefined behavior
The text was updated successfully, but these errors were encountered:
nikkon-dev
added a commit
to nikkon-dev/rust-bindgen
that referenced
this issue
Feb 9, 2025
Generated code (getter):
Generates warning in 2024 Edition:
Generated code (setter):
Warning:
Generated code (getter):
Warning:
Generated code (setter):
Warning:
The text was updated successfully, but these errors were encountered: