diff --git a/crates/guest-rust/src/lib.rs b/crates/guest-rust/src/lib.rs index a2a35d5b9..0c57f9ff0 100644 --- a/crates/guest-rust/src/lib.rs +++ b/crates/guest-rust/src/lib.rs @@ -574,7 +574,7 @@ extern crate std; /// # // ... /// # } /// # -/// export!(MyComponent with_types_in self); +/// export!(MyComponent, with_types_in self); /// # /// # fn main() {} /// ``` @@ -607,7 +607,7 @@ extern crate std; /// # // ... /// # } /// # -/// bindings::export!(MyComponent with_types_in bindings); +/// bindings::export!(MyComponent, with_types_in bindings); /// # /// # fn main() {} /// ``` diff --git a/crates/rust/src/interface.rs b/crates/rust/src/interface.rs index 4f4f00471..eb059a1b6 100644 --- a/crates/rust/src/interface.rs +++ b/crates/rust/src/interface.rs @@ -277,7 +277,7 @@ fn _resource_rep(handle: u32) -> *mut u8 #[doc(hidden)] {macro_export} macro_rules! {macro_name} {{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = {{ + ($ty:path, with_types_in $($path_to_types:tt)*) => (const _: () = {{ " ); diff --git a/crates/rust/src/lib.rs b/crates/rust/src/lib.rs index 3df749648..2045e3529 100644 --- a/crates/rust/src/lib.rs +++ b/crates/rust/src/lib.rs @@ -875,8 +875,8 @@ impl As{upcase} for {to_convert} {{ #[doc(hidden)] {macro_export} macro_rules! __export_{world_name}_impl {{ - ($ty:ident) => ({default_bindings_module}::{export_macro_name}!($ty with_types_in {default_bindings_module});); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ("# + ($ty:path) => ({default_bindings_module}::{export_macro_name}!($ty, with_types_in {default_bindings_module});); + ($ty:path, with_types_in $($path_to_types_root:tt)*) => ("# ); for (name, path_to_types) in self.export_macros.iter() { let mut path = "$($path_to_types_root)*".to_string(); @@ -884,7 +884,7 @@ macro_rules! __export_{world_name}_impl {{ path.push_str("::"); path.push_str(path_to_types) } - uwriteln!(self.src, "{path}::{name}!($ty with_types_in {path});"); + uwriteln!(self.src, "{path}::{name}!($ty, with_types_in {path});"); } // See comments in `finish` for why this conditionally happens here.