Skip to content

Commit bf8965b

Browse files
committed
Add expressions to list of places where attributes are accepted.
1 parent e4c1770 commit bf8965b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/attributes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ Attributes may be applied to many things in the language:
4444

4545
* All [item declarations] accept outer attributes while [external blocks],
4646
[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).
4849
* [Block expressions] accept outer and inner attributes, but only when they are
4950
the outer expression of an [expression statement] or the final expression of
5051
another block expression.
5152
* [Enum] variants and [struct] and [union] fields accept outer attributes.
5253
* [Match expression arms][match expressions] accept outer attributes.
5354
* [Generic lifetime or type parameter][generics] accept outer attributes.
55+
* Expressions accept outer attributes in limited situations, see [Expression
56+
Attributes] for details.
5457

5558
Some examples of attributes:
5659

@@ -600,3 +603,4 @@ You can implement `derive` for your own traits through [procedural macros].
600603
[`Termination`]: ../std/process/trait.Termination.html
601604
[where clause]: items/where-clauses.html
602605
[trait or lifetime bounds]: trait-bounds.html
606+
[Expression Attributes]: expressions.html#expression-attributes

0 commit comments

Comments
 (0)