Skip to content

Commit 3093d8d

Browse files
Update bindgen requirement from =0.71.1 to =0.72.0 (#39)
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/rust-bindgen/releases">bindgen's releases</a>.</em></p> <blockquote> <h2>v0.72.0</h2> <h2>Added</h2> <ul> <li>Report enums in ParseCallbacks.</li> <li>Refactor item_name method to use ItemInfo struct.</li> <li>Add callback to modify contents of macro</li> <li>Discovery callbacks for functions and methods.</li> <li>Options to generate uncallable C++ functions.</li> <li>Provide option to get real virtual fn receiver.</li> </ul> <h2>Changed</h2> <ul> <li>Generate bindings compatible with current rustc version by default.</li> </ul> <h2>Removed</h2> <ul> <li>Remove unused which-rustfmt feature</li> <li>Remove warning for opaque forward declarations</li> </ul> <h2>Fixed</h2> <ul> <li>More sophisticated handling of the triple in rust_to_clang_target</li> <li>Rename *-apple-ios-sim to ...simulator</li> <li>Fix OpenCL vectors that use &quot;ext_vector_type&quot;.</li> <li>Fix union layout when it contains 0 sized array.</li> <li>Avoid crashing on variadic unions without layout information.</li> <li>Distinguish char16_t.</li> <li>Fix bugs in --clang-macro-fallback</li> <li>Add missed unsafe in the raw_set_bit function</li> <li>Use link_name for dynamic library loading</li> <li>Add &quot;gen&quot; to list of rust keywords in 'rust_mangle'</li> <li>Use appropriate <code>rustfmt --format ...</code> param</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/rust-lang/rust-bindgen/compare/v0.71.1...v0.72.0">https://github.com/rust-lang/rust-bindgen/compare/v0.71.1...v0.72.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md">bindgen's changelog</a>.</em></p> <blockquote> <h1>0.72.0 (2025-06-08)</h1> <h2>Added</h2> <ul> <li>Report enums in ParseCallbacks.</li> <li>Refactor item_name method to use ItemInfo struct.</li> <li>Add callback to modify contents of macro</li> <li>Discovery callbacks for functions and methods.</li> <li>Options to generate uncallable C++ functions.</li> <li>Provide option to get real virtual fn receiver.</li> </ul> <h2>Changed</h2> <ul> <li>Generate bindings compatible with current rustc version by default.</li> </ul> <h2>Removed</h2> <ul> <li>Remove unused which-rustfmt feature</li> <li>Remove warning for opaque forward declarations</li> </ul> <h2>Fixed</h2> <ul> <li>More sophisticated handling of the triple in rust_to_clang_target</li> <li>Rename *-apple-ios-sim to ...simulator</li> <li>Fix OpenCL vectors that use &quot;ext_vector_type&quot;.</li> <li>Fix union layout when it contains 0 sized array.</li> <li>Avoid crashing on variadic unions without layout information.</li> <li>Distinguish char16_t.</li> <li>Fix bugs in --clang-macro-fallback</li> <li>Add missed unsafe in the raw_set_bit function</li> <li>Use link_name for dynamic library loading</li> <li>Add &quot;gen&quot; to list of rust keywords in 'rust_mangle'</li> <li>Use appropriate <code>rustfmt --format ...</code> param</li> </ul> <h1>v0.71.1 (2024-12-09)</h1> <h2>Fixed</h2> <ul> <li>Fix <code>--version</code> and <code>--generate-shell-completions</code> (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/3040">#3040</a>)</li> </ul> <h1>0.71.0 (2024-12-06)</h1> <h2>Added</h2> <ul> <li>Add the <code>ParseCallbacks::new_item_found</code> callback to expose the original and final name of structs, unions and enums (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/2658">#2658</a>).</li> <li>Add the <code>field_type_name</code> field to <code>FieldInfo</code> to expose the name of the type of a field (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/2863">#2863</a>)</li> <li>Add support for custom attributes with the <code>--with-attribute-custom</code> flag (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/2866">#2866</a>)</li> <li>Allow setting <code>--rust-target</code> to any Rust version supported by bindgen (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/2993">#2993</a>)</li> <li>Use c-string literals if the <code>--generate-cstr</code> flag is used for Rust targets after 1.77 under the 2021 edition (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/2996">#2996</a>)</li> <li>Add the <code>--rust-edition</code> flag which allows to select which Rust edition to target. (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/3002">#3002</a>, <a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/3013">#3013</a>)</li> <li>Use <code>unsafe extern</code> instead of <code>extern</code> in blocks for any Rust target after 1.82. (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/3015">#3015</a>)</li> </ul> <h2>Changed</h2> <ul> <li>The <code>--wrap-static-fns</code> related options no longer require the experimental feature or flag (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/2928">#2928</a>)</li> <li>Use the <code>Display</code> implementation instead of the <code>Debug</code> one for <code>BindgenError</code> in <code>bindgen-cli</code> (<a href="https://redirect.github.com/rust-lang/rust-bindgen/issues/3005">#3005</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/d0e7d6b5b763e93dd38f9ece05230979ede95a0a"><code>d0e7d6b</code></a> chore: Release</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/e7f0b9d90110e0f7d7d1d3f6d2ece75780d819d3"><code>e7f0b9d</code></a> Update changelog.</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/2882af23b05cd29518b414fb4a023544b3ee645b"><code>2882af2</code></a> Refactor item_name method to use ItemInfo struct</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/e2940cdcc20967799bece79b46682e8acc3bc042"><code>e2940cd</code></a> chore: Fix some warnings with latest stable.</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/5d7f6847690f84b6a4bf7b800cb3ae6057c5a207"><code>5d7f684</code></a> codegen: Avoid crashing on variadic unions without layout information.</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/2613129f1b39cf61e6ad3db7ec7d2a6806ed4fbd"><code>2613129</code></a> Remove unused which-rustfmt feature</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/fef156111e6e16e06f68511ee7fe7da69a8b9d97"><code>fef1561</code></a> Fix rustfmt errors</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/965a13cd6fc0946d4e98bfa36ce792777942fd12"><code>965a13c</code></a> Add test</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/b9c6984739fc76e4e088d4ea567634b8a0be1b73"><code>b9c6984</code></a> Use callbacks properly</li> <li><a href="https://github.com/rust-lang/rust-bindgen/commit/803d73ee09470005ce1a1d02ab559e1c7bd6dac8"><code>803d73e</code></a> Use parse_callbacks from options</li> <li>Additional commits viewable in <a href="https://github.com/rust-lang/rust-bindgen/compare/v0.71.1...v0.72.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 9f6f198 commit 3093d8d

4 files changed

Lines changed: 27 additions & 81 deletions

File tree

‎bindings_generator/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ edition = "2021"
55
publish = false
66

77
[dependencies]
8-
bindgen = "=0.71.1"
8+
bindgen = "=0.72.0"

‎bindings_generator/src/main.rs‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ fn main() {
66
}
77

88
fn compiler_bindings() {
9+
let msrv = bindgen::RustTarget::stable(81, 0).unwrap();
10+
911
let crate_root = Path::new(env!("CARGO_MANIFEST_DIR"));
1012
let header = crate_root.join("wrapper.h");
1113
let out_file = crate_root.join("../src/bindings.rs");
1214
let include_dir = crate_root.join("vendor");
1315

1416
bindgen::Builder::default()
1517
.header(header.to_str().unwrap())
18+
.rust_target(msrv)
1619
.parse_callbacks(Box::new(RenameCallback))
1720
.clang_args(&["-I", include_dir.to_str().unwrap()])
1821
.dynamic_link_require_all(true)
@@ -35,13 +38,16 @@ fn compiler_bindings() {
3538
}
3639

3740
fn runtime_bindings() {
41+
let msrv = bindgen::RustTarget::stable(81, 0).unwrap();
42+
3843
let crate_root = Path::new(env!("CARGO_MANIFEST_DIR"));
3944
let header = crate_root.join("runtime_wrapper.h");
4045
let out_file = crate_root.join("../runtime/src/bindings.rs");
4146
let include_dir = crate_root.join("vendor");
4247

4348
bindgen::Builder::default()
4449
.header(header.to_str().unwrap())
50+
.rust_target(msrv)
4551
.parse_callbacks(Box::new(RenameCallback))
4652
.clang_args(&["-I", include_dir.to_str().unwrap(), "-xc++"])
4753
.layout_tests(false)
@@ -72,14 +78,19 @@ fn runtime_bindings() {
7278
.expect("Couldn't write bindings!");
7379
}
7480

75-
use bindgen::callbacks::{EnumVariantValue, ParseCallbacks};
81+
use bindgen::callbacks::{EnumVariantValue, ItemInfo, ItemKind, ParseCallbacks};
7682

7783
#[derive(Debug)]
7884
struct RenameCallback;
7985
impl ParseCallbacks for RenameCallback {
80-
fn item_name(&self, item: &str) -> Option<String> {
81-
item.strip_suffix("__bindgen_ty_1")
82-
.map(|name| format!("{name}_u"))
86+
fn item_name(&self, item: ItemInfo<'_>) -> Option<String> {
87+
if let ItemKind::Type = item.kind {
88+
item.name
89+
.strip_suffix("__bindgen_ty_1")
90+
.map(|name| format!("{name}_u"))
91+
} else {
92+
None
93+
}
8394
}
8495

8596
fn enum_variant_name(

‎runtime/src/bindings.rs‎

Lines changed: 10 additions & 7 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]
@@ -64,9 +66,10 @@ where
6466
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
6567
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
6668
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);
69+
let byte = unsafe {
70+
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
71+
};
72+
unsafe { *byte = Self::change_bit(*byte, index, val) };
7073
}
7174
#[inline]
7275
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
@@ -93,7 +96,7 @@ where
9396
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
9497
let mut val = 0;
9598
for i in 0..(bit_width as usize) {
96-
if Self::raw_get_bit(this, i + bit_offset) {
99+
if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
97100
let index = if cfg!(target_endian = "big") {
98101
bit_width as usize - 1 - i
99102
} else {
@@ -133,7 +136,7 @@ where
133136
} else {
134137
i
135138
};
136-
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
139+
unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
137140
}
138141
}
139142
}

‎src/bindings.rs‎

Lines changed: 1 addition & 69 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
pub const IR_VERSION_MAJOR: u32 = 2;
44
pub const IR_VERSION_MINOR: u32 = 1;
@@ -23,20 +23,10 @@ pub enum IRComparisonFunction {
2323
}
2424
impl IRDescriptorRangeFlags {
2525
pub const None: IRDescriptorRangeFlags = IRDescriptorRangeFlags(0);
26-
}
27-
impl IRDescriptorRangeFlags {
2826
pub const DescriptorsVolatile: IRDescriptorRangeFlags = IRDescriptorRangeFlags(1);
29-
}
30-
impl IRDescriptorRangeFlags {
3127
pub const DataVolatile: IRDescriptorRangeFlags = IRDescriptorRangeFlags(2);
32-
}
33-
impl IRDescriptorRangeFlags {
3428
pub const DataStaticWhileSetAtExecute: IRDescriptorRangeFlags = IRDescriptorRangeFlags(4);
35-
}
36-
impl IRDescriptorRangeFlags {
3729
pub const DataStatic: IRDescriptorRangeFlags = IRDescriptorRangeFlags(8);
38-
}
39-
impl IRDescriptorRangeFlags {
4030
pub const DescriptorsStaticKeepingBufferBoundsChecks: IRDescriptorRangeFlags =
4131
IRDescriptorRangeFlags(65536);
4232
}
@@ -309,14 +299,8 @@ pub enum IRTessellatorOutputPrimitive {
309299
}
310300
impl IRRootDescriptorFlags {
311301
pub const None: IRRootDescriptorFlags = IRRootDescriptorFlags(0);
312-
}
313-
impl IRRootDescriptorFlags {
314302
pub const DataVolatile: IRRootDescriptorFlags = IRRootDescriptorFlags(2);
315-
}
316-
impl IRRootDescriptorFlags {
317303
pub const DataStaticWhileSetAtExecute: IRRootDescriptorFlags = IRRootDescriptorFlags(4);
318-
}
319-
impl IRRootDescriptorFlags {
320304
pub const DataStatic: IRRootDescriptorFlags = IRRootDescriptorFlags(8);
321305
}
322306
impl ::std::ops::BitOr<IRRootDescriptorFlags> for IRRootDescriptorFlags {
@@ -350,41 +334,17 @@ impl ::std::ops::BitAndAssign for IRRootDescriptorFlags {
350334
pub struct IRRootDescriptorFlags(pub ::std::os::raw::c_uint);
351335
impl IRRootSignatureFlags {
352336
pub const None: IRRootSignatureFlags = IRRootSignatureFlags(0);
353-
}
354-
impl IRRootSignatureFlags {
355337
pub const AllowInputAssemblerInputLayout: IRRootSignatureFlags = IRRootSignatureFlags(1);
356-
}
357-
impl IRRootSignatureFlags {
358338
pub const DenyVertexShaderRootAccess: IRRootSignatureFlags = IRRootSignatureFlags(2);
359-
}
360-
impl IRRootSignatureFlags {
361339
pub const DenyHullShaderRootAccess: IRRootSignatureFlags = IRRootSignatureFlags(4);
362-
}
363-
impl IRRootSignatureFlags {
364340
pub const DenyDomainShaderRootAccess: IRRootSignatureFlags = IRRootSignatureFlags(8);
365-
}
366-
impl IRRootSignatureFlags {
367341
pub const DenyGeometryShaderRootAccess: IRRootSignatureFlags = IRRootSignatureFlags(16);
368-
}
369-
impl IRRootSignatureFlags {
370342
pub const DenyPixelShaderRootAccess: IRRootSignatureFlags = IRRootSignatureFlags(32);
371-
}
372-
impl IRRootSignatureFlags {
373343
pub const AllowStreamOutput: IRRootSignatureFlags = IRRootSignatureFlags(64);
374-
}
375-
impl IRRootSignatureFlags {
376344
pub const LocalRootSignature: IRRootSignatureFlags = IRRootSignatureFlags(128);
377-
}
378-
impl IRRootSignatureFlags {
379345
pub const DenyAmplificationShaderRootAccess: IRRootSignatureFlags = IRRootSignatureFlags(256);
380-
}
381-
impl IRRootSignatureFlags {
382346
pub const DenyMeshShaderRootAccess: IRRootSignatureFlags = IRRootSignatureFlags(512);
383-
}
384-
impl IRRootSignatureFlags {
385347
pub const CBVSRVUAVHeapDirectlyIndexed: IRRootSignatureFlags = IRRootSignatureFlags(1024);
386-
}
387-
impl IRRootSignatureFlags {
388348
pub const SamplerHeapDirectlyIndexed: IRRootSignatureFlags = IRRootSignatureFlags(2048);
389349
}
390350
impl ::std::ops::BitOr<IRRootSignatureFlags> for IRRootSignatureFlags {
@@ -614,29 +574,13 @@ pub enum IRStaticBorderColor {
614574
}
615575
impl IRCompatibilityFlags {
616576
pub const None: IRCompatibilityFlags = IRCompatibilityFlags(0);
617-
}
618-
impl IRCompatibilityFlags {
619577
pub const BoundsCheck: IRCompatibilityFlags = IRCompatibilityFlags(1);
620-
}
621-
impl IRCompatibilityFlags {
622578
pub const VertexPositionInfToNan: IRCompatibilityFlags = IRCompatibilityFlags(2);
623-
}
624-
impl IRCompatibilityFlags {
625579
pub const TextureMinLODClamp: IRCompatibilityFlags = IRCompatibilityFlags(4);
626-
}
627-
impl IRCompatibilityFlags {
628580
pub const SamplerLODBias: IRCompatibilityFlags = IRCompatibilityFlags(8);
629-
}
630-
impl IRCompatibilityFlags {
631581
pub const PositionInvariance: IRCompatibilityFlags = IRCompatibilityFlags(16);
632-
}
633-
impl IRCompatibilityFlags {
634582
pub const SampleNanToZero: IRCompatibilityFlags = IRCompatibilityFlags(32);
635-
}
636-
impl IRCompatibilityFlags {
637583
pub const TexWriteRoundingRTZ: IRCompatibilityFlags = IRCompatibilityFlags(64);
638-
}
639-
impl IRCompatibilityFlags {
640584
pub const Suppress2DComputeDerivativeErrors: IRCompatibilityFlags = IRCompatibilityFlags(128);
641585
}
642586
impl ::std::ops::BitOr<IRCompatibilityFlags> for IRCompatibilityFlags {
@@ -805,11 +749,7 @@ pub enum IRHitGroupType {
805749
}
806750
impl IRRaytracingPipelineFlags {
807751
pub const None: IRRaytracingPipelineFlags = IRRaytracingPipelineFlags(0);
808-
}
809-
impl IRRaytracingPipelineFlags {
810752
pub const SkipTriangles: IRRaytracingPipelineFlags = IRRaytracingPipelineFlags(256);
811-
}
812-
impl IRRaytracingPipelineFlags {
813753
pub const SkipProceduralPrimitives: IRRaytracingPipelineFlags = IRRaytracingPipelineFlags(512);
814754
}
815755
impl ::std::ops::BitOr<IRRaytracingPipelineFlags> for IRRaytracingPipelineFlags {
@@ -891,17 +831,9 @@ pub enum IRBytecodeOwnership {
891831
}
892832
impl IRCompilerValidationFlags {
893833
pub const None: IRCompilerValidationFlags = IRCompilerValidationFlags(0);
894-
}
895-
impl IRCompilerValidationFlags {
896834
pub const ValidateRawRootResources: IRCompilerValidationFlags = IRCompilerValidationFlags(1);
897-
}
898-
impl IRCompilerValidationFlags {
899835
pub const ValidateAllResourcesBound: IRCompilerValidationFlags = IRCompilerValidationFlags(2);
900-
}
901-
impl IRCompilerValidationFlags {
902836
pub const ValidateDXIL: IRCompilerValidationFlags = IRCompilerValidationFlags(4);
903-
}
904-
impl IRCompilerValidationFlags {
905837
pub const All: IRCompilerValidationFlags = IRCompilerValidationFlags(-1);
906838
}
907839
impl ::std::ops::BitOr<IRCompilerValidationFlags> for IRCompilerValidationFlags {

0 commit comments

Comments
 (0)