rust-bindgen
rust-bindgen copied to clipboard
`static mut` deprecation
There is a current pre-RFC for deprecating static mut
in Rust 2024, in favor of better alternatives. I think bindgen should start using some of these alternatives instead of generating code that will become deprecated in the near-term. My understanding of the pre-RFC is that we should be using SyncUnsafeCell
in these FFI scenarios instead of static mut
Input C/C++ Header
extern const void* FOO;
Bindgen Invocation
bindgen::Builder::default()
.header("input.h")
.generate()
.unwrap()
Actual Results
extern "C" {
pub static mut Foo: *const ::core::ffi::c_void;
}