rust-lang / rust-lang/rustc-dev-guide
More information on attributes
@jdonszelmann is already working on this.
Since Nov 4, 2024.
- Dominant language
- HTML
- Stars
- 1.9k
- Forks
- 613
- Avg merge
- 17h 24m
- Merged PRs (30d)
- 39
Description
I recently wrote a clippy lint that deals with attributes (mostly outer attributes) and found very little information on how they are implemented. Most of the information I gathered through PR comments and issues in the rust repo. The reference only explains how to use the different attributes.
Do you think it would make sense to have a chapter on attributes in the guide?
Some weird things and questions I came across:
- The AST seems to contain attributes that are not in the actual source code (Is this because of macro expansion?) (https://github.com/rust-lang-nursery/rust-clippy/pull/2340#issuecomment-361055252)
- some expanded attributes seem to have an empty TokenStream and some not
- cfg_attr is special somehow
- In general lots of inconsistencies in the data from the syntax crate?
I would be happy to start something myself, but would need some pointers as to where the attribute stuff happens.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.