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

Allow adding annotations to items at comptime #5898

Closed
asterite opened this issue Sep 3, 2024 · 1 comment
Closed

Allow adding annotations to items at comptime #5898

asterite opened this issue Sep 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@asterite
Copy link
Collaborator

asterite commented Sep 3, 2024

Problem

In some of our macros certain functions/structs need annotations added to them: #[note] adds a bunch of stuff and then marks the struct as #[abi(notes)] for exporting.

Happy Case

There's an API to add annotations to items, likely something like this:

  • FunctionDefinition::add_annotation(self, Quoted)
  • StructDefinition::add_annotation(self, Quoted)
  • Module::add_annotationh(self, Quoted)

The above functions error if the Quoted value can't be parsed into an attribute.

Also, if these annotations refer to functions, those functions should eventually run in turn (this could be split into a separate issue, though)

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@asterite asterite added the enhancement New feature or request label Sep 3, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 3, 2024
@asterite
Copy link
Collaborator Author

asterite commented Sep 5, 2024

Duplicate of #5874

@asterite asterite marked this as a duplicate of #5874 Sep 5, 2024
@asterite asterite closed this as completed Sep 5, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant