Skip to content

Commit 8c1cb09

Browse files
committed
Match arm takes outer attributes in match exprs
1 parent dd822ea commit 8c1cb09

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/expressions/match-expr.md

+7
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ let message = match maybe_digit {
174174
};
175175
```
176176

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

0 commit comments

Comments
 (0)