diff --git a/crates/wiggle/generate/src/config.rs b/crates/wiggle/generate/src/config.rs index b6467da609..a430a8547a 100644 --- a/crates/wiggle/generate/src/config.rs +++ b/crates/wiggle/generate/src/config.rs @@ -27,7 +27,6 @@ mod kw { syn::custom_keyword!(witx); syn::custom_keyword!(witx_literal); syn::custom_keyword!(errors); - syn::custom_keyword!(async_); } impl Parse for ConfigField { @@ -45,8 +44,8 @@ impl Parse for ConfigField { input.parse::()?; input.parse::()?; Ok(ConfigField::Error(input.parse()?)) - } else if lookahead.peek(kw::async_) { - input.parse::()?; + } else if lookahead.peek(Token![async]) { + input.parse::()?; input.parse::()?; Ok(ConfigField::Async(input.parse()?)) } else { diff --git a/crates/wiggle/macro/src/lib.rs b/crates/wiggle/macro/src/lib.rs index e7ea3455f0..09ab2f6353 100644 --- a/crates/wiggle/macro/src/lib.rs +++ b/crates/wiggle/macro/src/lib.rs @@ -35,7 +35,7 @@ use syn::parse_macro_input; /// `{ errno => YourErrnoType }`. This allows you to use the `UserErrorConversion` /// trait to map these rich errors into the flat witx type, or to terminate /// WebAssembly execution by trapping. -/// * Optional: `async_` takes a set of witx modules and functions which are +/// * Optional: `async` takes a set of witx modules and functions which are /// made Rust `async` functions in the module trait. /// /// ## Example @@ -61,7 +61,7 @@ use syn::parse_macro_input; /// (result $r (expected $alias_to_float (error $errno))))) /// ", /// errors: { errno => YourRichError }, -/// async_: { example::double_int_return_float }, +/// async: { example::double_int_return_float }, /// }); /// /// /// Witx generates a set of traits, which the user must impl on a diff --git a/crates/wiggle/tests/atoms_async.rs b/crates/wiggle/tests/atoms_async.rs index 5fe20b326b..bdaf32d796 100644 --- a/crates/wiggle/tests/atoms_async.rs +++ b/crates/wiggle/tests/atoms_async.rs @@ -7,7 +7,7 @@ use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx}; wiggle::from_witx!({ witx: ["$CARGO_MANIFEST_DIR/tests/atoms.witx"], - async_: { + async: { atoms::{int_float_args, double_int_return_float} } }); diff --git a/crates/wiggle/wasmtime/macro/src/config.rs b/crates/wiggle/wasmtime/macro/src/config.rs index 9c5ee7b776..76a23dd31f 100644 --- a/crates/wiggle/wasmtime/macro/src/config.rs +++ b/crates/wiggle/wasmtime/macro/src/config.rs @@ -39,7 +39,6 @@ mod kw { syn::custom_keyword!(name); syn::custom_keyword!(docs); syn::custom_keyword!(function_override); - syn::custom_keyword!(async_); } impl Parse for ConfigField { @@ -65,8 +64,8 @@ impl Parse for ConfigField { input.parse::()?; input.parse::()?; Ok(ConfigField::Modules(input.parse()?)) - } else if lookahead.peek(kw::async_) { - input.parse::()?; + } else if lookahead.peek(Token![async]) { + input.parse::()?; input.parse::()?; #[cfg(feature = "async")] { @@ -76,7 +75,7 @@ impl Parse for ConfigField { { Err(syn::Error::new( input.span(), - "async_ not supported, enable cargo feature \"async\"", + "async not supported, enable cargo feature \"async\"", )) } } else { @@ -122,7 +121,7 @@ impl Config { #[cfg(feature = "async")] ConfigField::Async(c) => { if async_.is_some() { - return Err(Error::new(err_loc, "duplicate `async_` field")); + return Err(Error::new(err_loc, "duplicate `async` field")); } async_ = Some(c); } diff --git a/crates/wiggle/wasmtime/tests/atoms_async.rs b/crates/wiggle/wasmtime/tests/atoms_async.rs index f31da11ecb..e37d11c06a 100644 --- a/crates/wiggle/wasmtime/tests/atoms_async.rs +++ b/crates/wiggle/wasmtime/tests/atoms_async.rs @@ -6,7 +6,7 @@ use std::task::{Context, Poll, RawWaker, RawWakerVTable, Waker}; wasmtime_wiggle::from_witx!({ witx: ["$CARGO_MANIFEST_DIR/tests/atoms.witx"], - async_: { + async: { atoms::{double_int_return_float} } }); @@ -16,7 +16,7 @@ wasmtime_wiggle::wasmtime_integration!({ witx: ["$CARGO_MANIFEST_DIR/tests/atoms.witx"], ctx: Ctx, modules: { atoms => { name: Atoms } }, - async_: { + async: { atoms::double_int_return_float } });