diff --git a/crates/wasmtime/src/component/instance.rs b/crates/wasmtime/src/component/instance.rs index 39853e330c..81c526c1c6 100644 --- a/crates/wasmtime/src/component/instance.rs +++ b/crates/wasmtime/src/component/instance.rs @@ -194,6 +194,7 @@ struct Instantiator<'a> { imports: &'a PrimaryMap, } +#[derive(Clone)] pub enum RuntimeImport { Func(Arc), Module(Module), @@ -464,6 +465,17 @@ pub struct InstancePre { _marker: marker::PhantomData T>, } +// `InstancePre`'s clone does not require `T: Clone` +impl Clone for InstancePre { + fn clone(&self) -> Self { + Self { + component: self.component.clone(), + imports: self.imports.clone(), + _marker: self._marker, + } + } +} + impl InstancePre { /// This function is `unsafe` since there's no guarantee that the /// `RuntimeImport` items provided are guaranteed to work with the `T` of