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
2 changes: 1 addition & 1 deletion benches/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ fn wasm_to_host(c: &mut Criterion) {
return;
}

let mut typed = Linker::new(&engine);
let mut typed = Linker::<()>::new(&engine);
typed
.func_wrap_async("", "nop", |caller, _: ()| {
Box::new(async {
Expand Down
9 changes: 6 additions & 3 deletions crates/component-macro/tests/expanded/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -149,6 +149,7 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: foo::foo::chars::Host,
{
foo::foo::chars::add_to_linker(linker, get)?;
Expand Down Expand Up @@ -176,6 +177,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<&'a mut T, Host: Host>,
{
let mut inst = linker.instance("foo:foo/chars")?;
Expand Down Expand Up @@ -205,6 +207,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host,
{
add_to_linker_get_host(linker, get)
Expand Down
9 changes: 6 additions & 3 deletions crates/component-macro/tests/expanded/char_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -155,6 +155,7 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
T: Send,
U: foo::foo::chars::Host + Send,
{
Expand Down Expand Up @@ -184,6 +185,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<&'a mut T, Host: Host + Send>,
T: Send,
{
Expand Down Expand Up @@ -218,6 +220,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host + Send,
T: Send,
{
Expand Down
11 changes: 7 additions & 4 deletions crates/component-macro/tests/expanded/char_concurrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -155,7 +155,8 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: Send + foo::foo::chars::Host<Data = T> + 'static,
T: 'static,
T: Send + foo::foo::chars::Host<Data = T>,
U: Send + foo::foo::chars::Host<Data = T>,
{
foo::foo::chars::add_to_linker(linker, get)?;
Expand Down Expand Up @@ -201,6 +202,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<
&'a mut T,
Host: Host<Data = T> + Send,
Expand Down Expand Up @@ -278,6 +280,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host<Data = T> + Send,
T: Send + 'static,
{
Expand Down
9 changes: 6 additions & 3 deletions crates/component-macro/tests/expanded/char_tracing_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -155,6 +155,7 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
T: Send,
U: foo::foo::chars::Host + Send,
{
Expand Down Expand Up @@ -184,6 +185,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<&'a mut T, Host: Host + Send>,
T: Send,
{
Expand Down Expand Up @@ -247,6 +249,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host + Send,
T: Send,
{
Expand Down
9 changes: 6 additions & 3 deletions crates/component-macro/tests/expanded/conventions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -151,6 +151,7 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: foo::foo::conventions::Host,
{
foo::foo::conventions::add_to_linker(linker, get)?;
Expand Down Expand Up @@ -224,6 +225,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<&'a mut T, Host: Host>,
{
let mut inst = linker.instance("foo:foo/conventions")?;
Expand Down Expand Up @@ -333,6 +335,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host,
{
add_to_linker_get_host(linker, get)
Expand Down
9 changes: 6 additions & 3 deletions crates/component-macro/tests/expanded/conventions_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -157,6 +157,7 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
T: Send,
U: foo::foo::conventions::Host + Send,
{
Expand Down Expand Up @@ -232,6 +233,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<&'a mut T, Host: Host + Send>,
T: Send,
{
Expand Down Expand Up @@ -366,6 +368,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host + Send,
T: Send,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -157,7 +157,8 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: Send + foo::foo::conventions::Host<Data = T> + 'static,
T: 'static,
T: Send + foo::foo::conventions::Host<Data = T>,
U: Send + foo::foo::conventions::Host<Data = T>,
{
foo::foo::conventions::add_to_linker(linker, get)?;
Expand Down Expand Up @@ -329,6 +330,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<
&'a mut T,
Host: Host<Data = T> + Send,
Expand Down Expand Up @@ -708,6 +710,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host<Data = T> + Send,
T: Send + 'static,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
/// has been created through a [`Linker`](wasmtime::component::Linker).
///
/// For more information see [`TheWorld`] as well.
pub struct TheWorldPre<T> {
pub struct TheWorldPre<T: 'static> {
instance_pre: wasmtime::component::InstancePre<T>,
indices: TheWorldIndices,
}
impl<T> Clone for TheWorldPre<T> {
impl<T: 'static> Clone for TheWorldPre<T> {
fn clone(&self) -> Self {
Self {
instance_pre: self.instance_pre.clone(),
indices: self.indices.clone(),
}
}
}
impl<_T> TheWorldPre<_T> {
impl<_T: 'static> TheWorldPre<_T> {
/// Creates a new copy of `TheWorldPre` bindings which can then
/// be used to instantiate into a particular store.
///
Expand Down Expand Up @@ -157,6 +157,7 @@ const _: () = {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
T: Send,
U: foo::foo::conventions::Host + Send,
{
Expand Down Expand Up @@ -232,6 +233,7 @@ pub mod foo {
host_getter: G,
) -> wasmtime::Result<()>
where
T: 'static,
G: for<'a> wasmtime::component::GetHost<&'a mut T, Host: Host + Send>,
T: Send,
{
Expand Down Expand Up @@ -526,6 +528,7 @@ pub mod foo {
get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static,
) -> wasmtime::Result<()>
where
T: 'static,
U: Host + Send,
T: Send,
{
Expand Down
Loading