I was working on a small plugin framework, and I noticed that the macro expansion would fail in mysterious ways when the struct the #[VST3] attribute is applied on has generics. Putting comments inside of the struct or attaching attributes to the fields would also result in similar compiler errors because the generated allocate function would be malformed (with comments inside of the parameter list). This fixes the macro expansion for structs like these:
#[VST3(implements(IPluginFactory))]
pub struct Factory<P: Plugin> {
/// The type will be used for constructing plugin instances later.
_phantom: PhantomData<P>,
}
I was working on a small plugin framework, and I noticed that the macro expansion would fail in mysterious ways when the struct the
#[VST3]
attribute is applied on has generics. Putting comments inside of the struct or attaching attributes to the fields would also result in similar compiler errors because the generated allocate function would be malformed (with comments inside of the parameter list). This fixes the macro expansion for structs like these: