diff --git a/src/hyperlight_component_util/src/host.rs b/src/hyperlight_component_util/src/host.rs index 0fba3ff33..4b822b10c 100644 --- a/src/hyperlight_component_util/src/host.rs +++ b/src/hyperlight_component_util/src/host.rs @@ -61,6 +61,7 @@ fn emit_export_extern_decl<'a, 'b, 'c>( (#(#marshal,)*) ); let ::std::result::Result::Ok(#ret) = #ret else { panic!("bad return from guest {:?}", #ret) }; + #[allow(clippy::unused_unit)] #unmarshal } } diff --git a/src/hyperlight_host/tests/wit_test.rs b/src/hyperlight_host/tests/wit_test.rs index 1fd5e95cd..e42441dd8 100644 --- a/src/hyperlight_host/tests/wit_test.rs +++ b/src/hyperlight_host/tests/wit_test.rs @@ -155,6 +155,8 @@ impl test::wit::Roundtrip for Host { ) -> test::wit::roundtrip::Testenum { x } + + fn roundtrip_no_result(&mut self, _x: u32) {} } struct TestResource { @@ -330,6 +332,11 @@ mod wit_test { make_test! { roundtrip_variant, in arb_testvariant() } make_test! { roundtrip_enum, in arb_testenum() } + #[test] + fn test_simple_func() { + sb().roundtrip().roundtrip_no_result(42); + } + #[test] fn test_host_resource() { { diff --git a/src/tests/rust_guests/witguest/guest.wit b/src/tests/rust_guests/witguest/guest.wit index 5242fa1de..30b4969c5 100644 --- a/src/tests/rust_guests/witguest/guest.wit +++ b/src/tests/rust_guests/witguest/guest.wit @@ -25,6 +25,7 @@ interface roundtrip { roundtrip-tuple: func(x: tuple) -> tuple; roundtrip-option: func(x: option) -> option; roundtrip-result: func(x: result) -> result; + roundtrip-no-result: func(x: u32); record testrecord { contents: string, diff --git a/src/tests/rust_guests/witguest/src/main.rs b/src/tests/rust_guests/witguest/src/main.rs index 9fcabe087..1edf44ec1 100644 --- a/src/tests/rust_guests/witguest/src/main.rs +++ b/src/tests/rust_guests/witguest/src/main.rs @@ -113,6 +113,9 @@ impl test::wit::Roundtrip for Guest { ) -> test::wit::roundtrip::Testenum { (Host {}).roundtrip_enum(x) } + fn roundtrip_no_result(&mut self, x: u32) { + (Host {}).roundtrip_no_result(x) + } } impl test::wit::TestHostResource for Guest {