21
21
>   ;  ; | _ MetaItem_
22
22
>   ;  ; | _ MetaItem_ ` , ` _ MetaSeq_
23
23
24
- An _ attribute_ is a
25
- general, free-form metadatum that is interpreted according to name, convention,
26
- and language and compiler version. Attributes are modeled on Attributes in
27
- [ ECMA-335] , with the syntax coming from [ ECMA-334] \( C#).
24
+ An _ attribute_ is a general, free-form metadatum that is interpreted according
25
+ to name, convention, and language and compiler version. Attributes are modeled
26
+ on Attributes in [ ECMA-335] , with the syntax coming from [ ECMA-334] \( C#).
28
27
29
28
Attributes may appear as any of:
30
29
@@ -45,6 +44,9 @@ Attributes may be applied to many things in the language:
45
44
* All [ item declarations] accept outer attributes while [ external blocks] ,
46
45
[ functions] , [ implementations] , and [ modules] accept inner attributes.
47
46
* [ Statements] accept outer attributes.
47
+ * [ Block expressions] accept outer and inner attributes, but only when they are
48
+ the outer expression of an [ expression statement] or the final expression of
49
+ another block expression.
48
50
* [ Enum] variants and [ struct] and [ union] fields accept outer attributes.
49
51
* [ Match expression arms] [ match expressions ] accept outer attributes.
50
52
* [ Generic lifetime or type parameter] [ generics ] accept outer attributes.
@@ -557,6 +559,7 @@ You can implement `derive` for your own type through [procedural macros].
557
559
[ expression statement ] : statements.html#expression-statements
558
560
[ call expression ] : expressions/call-expr.html
559
561
[ block expression ] : expressions/block-expr.html
562
+ [ block expressions ] : expressions/block-expr.html
560
563
[ `Drop` ] : special-types-and-traits.html#drop
561
564
[ let statement ] : statements.html#let-statements
562
565
[ unstable book plugin ] : ../unstable-book/language-features/plugin.html#lint-plugins
@@ -569,4 +572,4 @@ You can implement `derive` for your own type through [procedural macros].
569
572
[ modules ] : items/modules.html
570
573
[ statements ] : statements.html
571
574
[ match expressions ] : expressions/match-expr.html
572
- [ external blocks ] : items/external-blocks.html
575
+ [ external blocks ] : items/external-blocks.html
0 commit comments