Files
wasmtime/crates/component-macro/tests/codegen.rs
Alex Crichton 83a8ca77cd Mirror default-owned change for guests in wit-bindgen (#6189)
This commit is a mirror of bytecodealliance/wit-bindgen#547 into the
`bindgen!` macro for Wasmtime. The new default is to generate only one
Rust type per WIT type input, regardless of if the representation can be
slightly more optimal in niche cases with more borrows. This should make
the macro easier to work with in the limit ideally.

Closes #6124
2023-04-10 16:27:13 +00:00

30 lines
794 B
Rust

macro_rules! gentest {
($id:ident $name:tt $path:tt) => {
mod $id {
mod sugar {
wasmtime::component::bindgen!(in $path);
}
mod normal {
wasmtime::component::bindgen!($name in $path);
}
mod async_ {
wasmtime::component::bindgen!({
path: $path,
async: true,
});
}
mod tracing {
wasmtime::component::bindgen!({
path: $path,
world: $name,
tracing: true,
duplicate_if_necessary: true,
});
}
}
// ...
};
}
component_macro_test_helpers::foreach!(gentest);