diff --git a/crates/environ/src/component/translate/inline.rs b/crates/environ/src/component/translate/inline.rs index 0dc5f83122..e5dbf786cd 100644 --- a/crates/environ/src/component/translate/inline.rs +++ b/crates/environ/src/component/translate/inline.rs @@ -141,7 +141,9 @@ pub(super) fn run( ComponentFuncDef::Lifted { ty, func, options } => { Export::LiftedFunction { ty, func, options } } - ComponentFuncDef::Import(_) => unimplemented!("reexporting a function import"), + ComponentFuncDef::Import(_) => { + bail!("component export `{name}` is a reexport of an imported function which is not implemented") + } }, ComponentItemDef::Instance(_) => unimplemented!("exporting an instance to the host"), diff --git a/tests/misc_testsuite/component-model/import.wast b/tests/misc_testsuite/component-model/import.wast new file mode 100644 index 0000000000..4633ba2615 --- /dev/null +++ b/tests/misc_testsuite/component-model/import.wast @@ -0,0 +1,5 @@ +(assert_invalid + (component + (import "host-return-two" (func $f (result u32))) + (export "x" (func $f))) + "component export `x` is a reexport of an imported function which is not implemented")