Skip to content

Commit 29bb237

Browse files
committed
Match arm takes outer attributes in match exprs
1 parent e13679e commit 29bb237

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/expressions/match-expr.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ let message = match maybe_digit {
175175
};
176176
```
177177

178+
## Attributes on match arms
179+
180+
Outer attributes are allowed on match arms. The only attributes that have
181+
meaning on match arms are [`cfg`], `cold`, and the [lint check attributes].
182+
178183
[_Expression_]: expressions.html
179184
[_BlockExpression_]: expressions/block-expr.html#block-expressions
180185
[place expression]: expressions.html#place-expressions-and-value-expressions
@@ -183,3 +188,5 @@ let message = match maybe_digit {
183188
[numeric types]: types.html#numeric-types
184189
[_InnerAttribute_]: attributes.html
185190
[_OuterAttribute_]: attributes.html
191+
[`cfg`]: attributes.html#conditional-compilation
192+
[lint check attributes]: attributes.html#lint-check-attributes

0 commit comments

Comments
 (0)