Skip to content

Commit ca390ab

Browse files
committed
InstanceType no longer has lifetime
1 parent 7b0c755 commit ca390ab

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

crates/wasmtime/src/runtime/component/instance.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::prelude::*;
1010
use crate::runtime::vm::component::{ComponentInstance, OwnedComponentInstance};
1111
use crate::runtime::vm::{CompiledModuleId, VMFuncRef};
1212
use crate::store::{StoreOpaque, Stored};
13-
use crate::{AsContext, AsContextMut, Engine, Module, StoreContextMut};
13+
use crate::{AsContextMut, Engine, Module, StoreContextMut};
1414
use alloc::sync::Arc;
1515
use core::marker;
1616
use core::ptr::NonNull;
@@ -364,8 +364,8 @@ impl Instance {
364364
}
365365

366366
#[doc(hidden)]
367-
pub fn instance_type<'a, T>(&self, store: &'a crate::Store<T>) -> InstanceType<'a> {
368-
let data = store.as_context().0[self.0].as_ref().unwrap();
367+
pub fn instance_type(&self, mut store: impl AsContextMut) -> InstanceType {
368+
let data = store.as_context_mut().0[self.0].as_ref().unwrap();
369369
data.ty()
370370
}
371371
}

crates/wasmtime/src/runtime/component/linker.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ impl<T> Linker<T> {
215215
let ctype = types::Component::from(
216216
component.ty(),
217217
&InstanceType {
218-
types: cx.types,
219-
resources: &cx.imported_resources,
218+
types: cx.types.clone(),
219+
resources: cx.imported_resources.clone(),
220220
},
221221
);
222222
// Now that all imports are known to be defined and satisfied by this

crates/wasmtime/src/runtime/component/types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ impl ComponentFunc {
727727
}
728728

729729
#[doc(hidden)]
730-
pub fn typecheck<Params, Return>(&self, cx: &InstanceType<'_>) -> anyhow::Result<()>
730+
pub fn typecheck<Params, Return>(&self, cx: &InstanceType) -> anyhow::Result<()>
731731
where
732732
Params: crate::component::ComponentNamedList + crate::component::Lower,
733733
Return: crate::component::ComponentNamedList + crate::component::Lift,
@@ -831,7 +831,7 @@ impl Component {
831831

832832
/// Get the InstanceType, a helper representation used for typechecking
833833
#[doc(hidden)]
834-
pub fn instance_type(&self) -> InstanceType<'_> {
834+
pub fn instance_type(&self) -> InstanceType {
835835
self.0.instance()
836836
}
837837
}

0 commit comments

Comments
 (0)