File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,16 @@ Attributes may be applied to many things in the language:
44
44
45
45
* All [ item declarations] accept outer attributes while [ external blocks] ,
46
46
[ functions] , [ implementations] , and [ modules] accept inner attributes.
47
- * [ Statements] accept outer attributes.
47
+ * Most [ statements] accept outer attributes (see [ Expression Attributes] for
48
+ limitations on expression statements).
48
49
* [ Block expressions] accept outer and inner attributes, but only when they are
49
50
the outer expression of an [ expression statement] or the final expression of
50
51
another block expression.
51
52
* [ Enum] variants and [ struct] and [ union] fields accept outer attributes.
52
53
* [ Match expression arms] [ match expressions ] accept outer attributes.
53
54
* [ Generic lifetime or type parameter] [ generics ] accept outer attributes.
55
+ * Expressions accept outer attributes in limited situations, see [ Expression
56
+ Attributes] for details.
54
57
55
58
Some examples of attributes:
56
59
@@ -600,3 +603,4 @@ You can implement `derive` for your own traits through [procedural macros].
600
603
[ `Termination` ] : ../std/process/trait.Termination.html
601
604
[ where clause ] : items/where-clauses.html
602
605
[ trait or lifetime bounds ] : trait-bounds.html
606
+ [ Expression Attributes ] : expressions.html#expression-attributes
You can’t perform that action at this time.
0 commit comments