Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test proc macros #3092

Open
3 of 5 tasks
P-E-P opened this issue Jul 20, 2024 · 0 comments
Open
3 of 5 tasks

Test proc macros #3092

P-E-P opened this issue Jul 20, 2024 · 0 comments
Assignees

Comments

@P-E-P
Copy link
Member

P-E-P commented Jul 20, 2024

We cannot check proc macro entirely for now but there are a few things we could check:

  • proc_macro and derive declarations are not used within a regular context
  • no error message is emitted when a declaration occur within a proc macro
  • eventually add a scan assembler test for the proc macro output, we could make sure the proper symbols are emitted
  • functions tagged with #[proc_macro] must be `pub
  • function-like proc macro has incorrect signature
extern crate proc_macro;
use proc_macro::TokenStream;

#[proc_macro]
pub fn my_proc_macro(ts: TokenStream) -> TokenStream {
    ts
}
@P-E-P P-E-P added this to the Procedural Macros 2 milestone Jul 20, 2024
@P-E-P P-E-P self-assigned this Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant