Skip to content

Commit 5ed99dc

Browse files
Update bindgen requirement from 0.71 to 0.72 (#5172)
* Update bindgen requirement from 0.71 to 0.72 Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version. - [Release notes](https://github.com/rust-lang/rust-bindgen/releases) - [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md) - [Commits](rust-lang/rust-bindgen@v0.71.0...v0.72.0) --- updated-dependencies: - dependency-name: bindgen dependency-version: 0.72.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Apply Rust patches --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Anthony Rossi <41394064+anrossi@users.noreply.github.com>
1 parent 3ef821e commit 5ed99dc

3 files changed

Lines changed: 43 additions & 29 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ overwrite = [ "dep:bindgen" ]
9292

9393
[build-dependencies]
9494
cmake = { version = "0.1", optional = true }
95-
bindgen = { version = "0.71", optional = true }
95+
bindgen = { version = "0.72", optional = true }
9696

9797
[dependencies]
9898
bitflags = "2.9"

src/rs/ffi/linux_bindings.rs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* automatically generated by rust-bindgen 0.71.1 */
1+
/* automatically generated by rust-bindgen 0.72.0 */
22

33
#[repr(C)]
44
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
@@ -36,7 +36,9 @@ where
3636
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
3737
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
3838
let byte_index = index / 8;
39-
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
39+
let byte = unsafe {
40+
*(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
41+
};
4042
Self::extract_bit(byte, index)
4143
}
4244
#[inline]
@@ -47,11 +49,7 @@ where
4749
index % 8
4850
};
4951
let mask = 1 << bit_index;
50-
if val {
51-
byte | mask
52-
} else {
53-
byte & !mask
54-
}
52+
if val { byte | mask } else { byte & !mask }
5553
}
5654
#[inline]
5755
pub fn set_bit(&mut self, index: usize, val: bool) {
@@ -64,9 +62,10 @@ where
6462
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
6563
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
6664
let byte_index = index / 8;
67-
let byte =
68-
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
69-
*byte = Self::change_bit(*byte, index, val);
65+
let byte = unsafe {
66+
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
67+
};
68+
unsafe { *byte = Self::change_bit(*byte, index, val) };
7069
}
7170
#[inline]
7271
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
@@ -93,7 +92,7 @@ where
9392
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
9493
let mut val = 0;
9594
for i in 0..(bit_width as usize) {
96-
if Self::raw_get_bit(this, i + bit_offset) {
95+
if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
9796
let index = if cfg!(target_endian = "big") {
9897
bit_width as usize - 1 - i
9998
} else {
@@ -133,7 +132,7 @@ where
133132
} else {
134133
i
135134
};
136-
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
135+
unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
137136
}
138137
}
139138
}
@@ -5731,7 +5730,11 @@ const _: () = {
57315730
[::std::mem::size_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14>() - 16usize];
57325731
["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14"]
57335732
[::std::mem::align_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14>() - 8usize];
5734-
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionStateLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14 , ResumptionStateLength) - 0usize] ;
5733+
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionStateLength"]
5734+
[::std::mem::offset_of!(
5735+
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14,
5736+
ResumptionStateLength
5737+
) - 0usize];
57355738
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionState"][::std::mem::offset_of!(
57365739
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14,
57375740
ResumptionState
@@ -5750,7 +5753,11 @@ const _: () = {
57505753
[::std::mem::size_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15>() - 16usize];
57515754
["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15"]
57525755
[::std::mem::align_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15>() - 8usize];
5753-
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicketLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15 , ResumptionTicketLength) - 0usize] ;
5756+
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicketLength"]
5757+
[::std::mem::offset_of!(
5758+
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15,
5759+
ResumptionTicketLength
5760+
) - 0usize];
57545761
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicket"][::std::mem::offset_of!(
57555762
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15,
57565763
ResumptionTicket

src/rs/ffi/win_bindings.rs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* automatically generated by rust-bindgen 0.71.1 */
1+
/* automatically generated by rust-bindgen 0.72.0 */
22

33
#[repr(C)]
44
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
@@ -36,7 +36,9 @@ where
3636
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
3737
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
3838
let byte_index = index / 8;
39-
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
39+
let byte = unsafe {
40+
*(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
41+
};
4042
Self::extract_bit(byte, index)
4143
}
4244
#[inline]
@@ -47,11 +49,7 @@ where
4749
index % 8
4850
};
4951
let mask = 1 << bit_index;
50-
if val {
51-
byte | mask
52-
} else {
53-
byte & !mask
54-
}
52+
if val { byte | mask } else { byte & !mask }
5553
}
5654
#[inline]
5755
pub fn set_bit(&mut self, index: usize, val: bool) {
@@ -64,9 +62,10 @@ where
6462
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
6563
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
6664
let byte_index = index / 8;
67-
let byte =
68-
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
69-
*byte = Self::change_bit(*byte, index, val);
65+
let byte = unsafe {
66+
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
67+
};
68+
unsafe { *byte = Self::change_bit(*byte, index, val) };
7069
}
7170
#[inline]
7271
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
@@ -93,7 +92,7 @@ where
9392
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
9493
let mut val = 0;
9594
for i in 0..(bit_width as usize) {
96-
if Self::raw_get_bit(this, i + bit_offset) {
95+
if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
9796
let index = if cfg!(target_endian = "big") {
9897
bit_width as usize - 1 - i
9998
} else {
@@ -133,7 +132,7 @@ where
133132
} else {
134133
i
135134
};
136-
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
135+
unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
137136
}
138137
}
139138
}
@@ -5761,7 +5760,11 @@ const _: () = {
57615760
[::std::mem::size_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14>() - 16usize];
57625761
["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14"]
57635762
[::std::mem::align_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14>() - 8usize];
5764-
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionStateLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14 , ResumptionStateLength) - 0usize] ;
5763+
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionStateLength"]
5764+
[::std::mem::offset_of!(
5765+
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14,
5766+
ResumptionStateLength
5767+
) - 0usize];
57655768
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionState"][::std::mem::offset_of!(
57665769
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14,
57675770
ResumptionState
@@ -5780,7 +5783,11 @@ const _: () = {
57805783
[::std::mem::size_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15>() - 16usize];
57815784
["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15"]
57825785
[::std::mem::align_of::<QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15>() - 8usize];
5783-
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicketLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15 , ResumptionTicketLength) - 0usize] ;
5786+
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicketLength"]
5787+
[::std::mem::offset_of!(
5788+
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15,
5789+
ResumptionTicketLength
5790+
) - 0usize];
57845791
["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicket"][::std::mem::offset_of!(
57855792
QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15,
57865793
ResumptionTicket

0 commit comments

Comments
 (0)