Skip to content

Commit f1f5d54

Browse files
committed
List where attributes are accepted and which kind (outer/inner)
1 parent 9eeb5ae commit f1f5d54

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/attributes.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ item that the attribute is declared within. _Outer attributes_, written without
4040
the bang after the hash, apply to the item or generic parameter that follow the
4141
attribute.
4242

43-
Any [item declaration] or [generic lifetime or type parameter][generics] may
44-
have an attribute applied to it.
43+
Attributes may be applied to many things in the language:
44+
45+
* All [item declarations] accept outer attributes while [external blocks],
46+
[functions], [implementations], and [modules] accept inner attributes.
47+
* [Statements] accept outer attributes.
48+
* [Enum] variants and [struct] and [union] fields accept outer attributes.
49+
* [Match expression arms][match expressions] accept outer attributes.
50+
* [Generic lifetime or type parameter][generics] accept outer attributes.
4551

4652
An example of attributes:
4753

@@ -545,5 +551,10 @@ You can implement `derive` for your own type through [procedural macros].
545551
[zero-variant enum]: items/enumerations.html#zero-variant-enums
546552
[ECMA-334]: https://www.ecma-international.org/publications/standards/Ecma-334.htm
547553
[ECMA-335]: https://www.ecma-international.org/publications/standards/Ecma-335.htm
548-
[item declaration]: items.html
549-
[generics]: generics.html
554+
[item declarations]: items.html
555+
[generics]: items/generics.html
556+
[implementations]: items/implementations.html
557+
[modules]: items/modules.html
558+
[statements]: statements.html
559+
[match expressions]: expressions/match-expr.html
560+
[external blocks]: items/external-blocks.html

0 commit comments

Comments
 (0)