21
21
>   ;  ; | _ MetaItem_
22
22
>   ;  ; | _ MetaItem_ ` , ` _ MetaSeq_
23
23
24
- Any [ item declaration] or [ generic lifetime or type parameter] [ generics ] may
25
- have an attribute applied to it. Attributes are modeled on Attributes in
26
- [ ECMA-335] , with the syntax coming from [ ECMA-334] \ (C#). An _ attribute_ is a
27
- general, free-form metadatum that is interpreted according to name, convention,
28
- and language and compiler version. Attributes may appear as any of:
24
+ Any [ item declaration] , [ statement] , [ block expression] or
25
+ [ generic lifetime or type parameter] [ generics ] may have an attribute applied to
26
+ it. Attributes are modeled on Attributes in [ ECMA-335] , with the syntax coming
27
+ from [ ECMA-334] \ (C#). An _ attribute_ is a general, free-form metadatum that is
28
+ interpreted according to name, convention, and language and compiler version.
29
+ Attributes may appear as any of:
29
30
30
31
* A single identifier, the attribute name
31
32
* An identifier followed by the equals sign '=' and a literal, providing a
@@ -35,9 +36,9 @@ and language and compiler version. Attributes may appear as any of:
35
36
* An identifier followed by a parenthesized list of sub-attribute arguments
36
37
37
38
_ Inner attributes_ , written with a bang ("!") after the hash ("#"), apply to the
38
- item that the attribute is declared within. _ Outer attributes _ , written without
39
- the bang after the hash, apply to the item or generic parameter that follow the
40
- attribute.
39
+ item or block expression that the attribute is declared within. _ Outer
40
+ attributes _ , written without the bang after the hash, apply to the thing that
41
+ follows the attribute.
41
42
42
43
An example of attributes:
43
44
@@ -542,4 +543,6 @@ You can implement `derive` for your own type through [procedural macros].
542
543
[ ECMA 334 ] : https://www.ecma-international.org/publications/standards/Ecma-334.htm
543
544
[ ECMA 335 ] : https://www.ecma-international.org/publications/standards/Ecma-335.htm
544
545
[ item declaration ] : items.html
545
- [ generics ] : generics.html
546
+ [ generics ] : generics.html
547
+ [ statement ] : statements.html
548
+ [ block expression ] : expressions/block-expr.html
0 commit comments