22
33> ** <sup >Syntax</sup >** \
44> _ Pattern_ :\
5- >   ;  ;   ;  ; ` | ` <sup >?</sup > _ PatternNoTopAlt_ ` | ` _ PatternNoTopAlt_
6- >   ;  ; | _ PatternNoTopAlt_
5+ >   ;  ;   ;  ; ` | ` <sup >?</sup > _ PatternNoTopAlt_ ( ` | ` _ PatternNoTopAlt_ )<sup >\* </sup >
76>
87> _ PatternNoTopAlt_ :\
98>   ;  ;   ;  ; _ PatternWithoutRange_ \
10- >   ;  ; | [ _ RangePattern_ ]
9+ >   ;  ; | [ _ RangePattern_ ] \
1110>   ;  ; | ` ( ` _ Pattern_ ` ) `
1211>
1312> _ PatternWithoutRange_ :\
@@ -763,12 +762,11 @@ refer to refutable constants or enum variants for enums with multiple variants.
763762
764763## Or-patterns
765764
766- _ Or-patterns_ are patterns that match on either of two sub-patterns (e.g. `A |
767- B`). They can nest arbitrarily. Syntactically, or-patterns are allowed in any
768- of the places where other patterns are allowed (represented by the _ Pattern_
769- production), with the exceptions of function and closure arguments (represented
770- by the _ PatternNoTopAlt_ production). Additionally, the macro ` :pat ` matchers
771- only match or-patterns in the 2021+ editions.
765+ _ Or-patterns_ are patterns that match on one of two or more sub-patterns (e.g.
766+ ` A | B | C ` ). They can nest arbitrarily. Syntactically, or-patterns are allowed
767+ in any of the places where other patterns are allowed (represented by the
768+ _ Pattern_ production), with the exceptions of ` let ` -bindings and function and
769+ closure arguments (represented by the _ PatternNoTopAlt_ production).
772770
773771### Static semantics
774772
@@ -780,8 +778,6 @@ only match or-patterns in the 2021+ editions.
780778 + the type of any two bindings with the same name in ` p ` and ` q ` do not unify
781779 with respect to types or binding modes.
782780
783- [ type coercions ] : https://doc.rust-lang.org/reference/type-coercions.html
784-
785781 Unification of types is in all instances aforementioned exact and
786782 implicit [ type coercions] do not apply.
787783
@@ -838,3 +834,4 @@ only match or-patterns in the 2021+ editions.
838834[ structs ] : items/structs.md
839835[ tuples ] : types/tuple.md
840836[ scrutinee ] : glossary.md#scrutinee
837+ [ type coercions ] : type-coercions.md
0 commit comments