Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions crates/gen-guest-rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ impl InterfaceGenerator<'_> {
uwrite!(
self.src,
"
#[allow(unused_imports)]
use wit_bindgen_guest_rust::rt::{{alloc, vec::Vec, string::String}};

#[repr(align({align}))]
struct _RetArea([u8; {size}]);
static mut _RET_AREA: _RetArea = _RetArea([0; {size}]);
Expand All @@ -347,9 +350,6 @@ impl InterfaceGenerator<'_> {
"
#[allow(clippy::all)]
pub mod {snake} {{
#[allow(unused_imports)]
use wit_bindgen_guest_rust::rt::{{alloc, vec::Vec, string::String}};

{module}
}}
"
Expand Down Expand Up @@ -528,11 +528,7 @@ impl InterfaceGenerator<'_> {
macro_src.push_str(") {\n");

// Finish out the macro here
uwrite!(
macro_src,
"{prefix}{module_name}::post_return_{name_snake}::<$t>(",
prefix = self.gen.opts.macro_call_prefix.as_deref().unwrap_or("")
);
uwrite!(macro_src, "{prefix}post_return_{name_snake}::<$t>(");
for param in params.iter() {
uwrite!(macro_src, "{param},");
}
Expand Down
3 changes: 3 additions & 0 deletions tests/codegen/just-export.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
default world foo {
export generate: func(name: string, wit: list<u8>) -> result<list<tuple<string, list<u8>>>, string>
}