I have unit tests written for all of my proc macros by using proc_macro2 in my implementation and running the code as a normal Rust test. However if I use proc-macro-error-2 I get errors like
proc-macro-error2 API cannot be used outside of `entry_point` invocation,
If I wrap my macro code in a proc_macro_error2::entry_point call I get this error
procedural macro API is used outside of a procedural macro
I think the problem stems from the fact that entry_point() returns a proc_macro::TokenStream instead of proc_macro2::TokenStream. Is there another supported way of how to invoke code that contains proc-macro-error-2 code in a test environment?
I have unit tests written for all of my proc macros by using proc_macro2 in my implementation and running the code as a normal Rust test. However if I use proc-macro-error-2 I get errors like
If I wrap my macro code in a
proc_macro_error2::entry_pointcall I get this errorI think the problem stems from the fact that
entry_point()returns aproc_macro::TokenStreaminstead ofproc_macro2::TokenStream. Is there another supported way of how to invoke code that contains proc-macro-error-2 code in a test environment?