wasi-rs
wasi-rs copied to clipboard
`witx-bingen` generates incorrect lifetimes
In regenerating the wasi-nn bindings from a WITX file using the latest version of witx-bingen on main, I found that it generated code that would not compile. The lifetimes of several fields seemed to be incorrect--under-specified--and the bindings would no longer compile. I manually made the following changes which seem to resolve the compilation failure.
#[repr(C)]
#[derive(Copy, Clone, Debug)]
-pub struct Tensor {
- pub dimensions: TensorDimensions<'_>,
+pub struct Tensor<'a> {
+ pub dimensions: TensorDimensions<'a>,
pub type_: TensorType,
- pub data: TensorData<'_>,
+ pub data: TensorData<'a>,
}
pub type GraphBuilder<'a> = &'a [u8];
-pub type GraphBuilderArray<'a> = &'a [GraphBuilder<'_>];
+pub type GraphBuilderArray<'a> = &'a [GraphBuilder<'a>];
pub type Graph = u32;
Is this fixable and where could this be fixed in witx-bindgen?
cc: @pchickey?