feat(rust)!: use path in generated export! macro instead of ident#1566
feat(rust)!: use path in generated export! macro instead of ident#1566tqwewe wants to merge 2 commits intobytecodealliance:mainfrom
export! macro instead of ident#1566Conversation
export! macro instead of identexport! macro instead of ident
Changes the generated `export!` macro to accept a `$ty:path` instead of `$ty:ident` for more flexibility. Requires the `with_types_in` separator to be changed to `, with_types_in`, since a `path` cannot be followed by an ident in macros.
|
Thanks! Personally though I think that this'd need to be bikeshed a bit since the syntax here is pretty odd. I'm not sure if the restrictions on tokens after I'll also note that there's a workaround today (I think) but I also agree it'd be best to not need a workaround, so that's just for a temporary state of affairs. |
|
Yeah I actually initially used the syntax I agree the API is a bit weird. Not sure of any better alternatives than just
I think I had the same issue when I initially tried |
|
Perhaps we could take a leaf out of Wasmtime's book? Something like: generate!(MyType);
generate!(()); // uses `$t:ty` for this
generate!({
ty: MyType,
with_types_in: some::other::module,
}); |
Changes the generated
export!macro to accept a$ty:pathinstead of$ty:identfor more flexibility.Requires the
with_types_inseparator to be changed to, with_types_in, since apathcannot be followed by an ident in macros.Closes #1564