-
Notifications
You must be signed in to change notification settings - Fork 252
Open
Labels
gen-rustRelated to bindings for Rust-compiled-to-WebAssemblyRelated to bindings for Rust-compiled-to-WebAssembly
Description
Consider this WIT
package test:test;
interface original {
resource extra-options;
record options {
extra: option<borrow<extra-options>>,
}
}
interface adapter {
use original.{options};
f: func(x: options);
}
world root {
export original;
export adapter;
}
wit-bindgen generates this code for adapter interface,
pub mod adapter {
pub type Options<'a,> = super::super::super::super::exports::test::test::original::Options<'a,>;
pub unsafe fn _export_f_cabi<T: Guest>(arg0: i32,arg1: i32,) {
...
let e = ExtraOptionsBorrow::lift(arg1 as u32 as usize);
...
}
}
ExtraOptionsBorrow needs to use relative path, otherwise the code won't compile.
If the world doesn't export original, the generated code is using the relative path correctly.
Metadata
Metadata
Assignees
Labels
gen-rustRelated to bindings for Rust-compiled-to-WebAssemblyRelated to bindings for Rust-compiled-to-WebAssembly