-
Notifications
You must be signed in to change notification settings - Fork 530
General attribute docs improvements #352
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few things I noticed going through this.
src/attributes.md
Outdated
(C#). An attribute is a general, free-form metadatum that is interpreted | ||
according to name, convention, and language and compiler version. Attributes | ||
may appear as any of: | ||
An _attribute_ is a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short line
src/attributes.md
Outdated
* [Statements] accept outer attributes. | ||
* [Enum] variants and [struct] and [union] fields accept outer attributes. | ||
* [Match expression arms][match expressions] accept outer attributes. | ||
* [Generic lifetime or type parameter][generics] accept outer attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(unsafe) block statements accept inner attributes
src/items/implementations.md
Outdated
## Attributes in Implementations | ||
|
||
Implementations may contain inner [attributes] inside the brackets that contain | ||
the associated items. They must come before the associated items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could there be a sentence on what attributes are allowed on impls?
Addressed comments. Also added which attributes are allowed on block expressions and statements. And apparently, as per the example I included on the block expressions page, block expressions also allow outer attributes and the only place you'd be able to tell that isn't overlapping with statements taking attributes is the return expression of a block expression. Go figure. I'll add which attributes are allowed on functions / modules / the main module/ other items / variants and fields later. |
56473c4
to
4b2dc6e
Compare
Rebased against master due to merge conflict. |
Rebased again for another merge conflict. |
Each commit does its own small thing.
This builds on top of #350, so merge that before taking a look at this.