Skip to content

Commit 7edf953

Browse files
committed
Fix tuple index for struct field pattern.
1 parent dd1e2e6 commit 7edf953

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/patterns.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ Reference patterns are always irrefutable.
469469
> _StructPatternField_ :\
470470
> &nbsp;&nbsp; [_OuterAttribute_] <sup>\*</sup>\
471471
> &nbsp;&nbsp; (\
472-
> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [INTEGER_LITERAL] `:` [_Pattern_]\
472+
> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [TUPLE_INDEX] `:` [_Pattern_]\
473473
> &nbsp;&nbsp; &nbsp;&nbsp; | [IDENTIFIER] `:` [_Pattern_]\
474474
> &nbsp;&nbsp; &nbsp;&nbsp; | `ref`<sup>?</sup> `mut`<sup>?</sup> [IDENTIFIER]\
475475
> &nbsp;&nbsp; )
@@ -479,6 +479,7 @@ Reference patterns are always irrefutable.
479479
> &nbsp;&nbsp; `..`
480480
481481
[_OuterAttribute_]: attributes.html
482+
[TUPLE_INDEX]: tokens.html#integer-literals
482483

483484
Struct patterns match struct values that match all criteria defined by its subpatterns.
484485
They are also used to [destructure](#destructuring) a struct.

0 commit comments

Comments
 (0)