1010>   ;  ; | [ _ IdentifierPattern_ ] \
1111>   ;  ; | [ _ WildcardPattern_ ] \
1212>   ;  ; | [ _ RestPattern_ ] \
13- >   ;  ; | [ _ ObsoleteRangePattern_ ] \
1413>   ;  ; | [ _ ReferencePattern_ ] \
1514>   ;  ; | [ _ StructPattern_ ] \
1615>   ;  ; | [ _ TupleStructPattern_ ] \
@@ -401,7 +400,14 @@ match tuple {
401400
402401> ** <sup >Syntax</sup >** \
403402> _ RangePattern_ :\
404- >   ;  ;   ;  ; _ RangePatternBound_ ` ..= ` _ RangePatternBound_ \
403+ >   ;  ;   ;  ; _ InclusiveRangePattern_ \
404+ >   ;  ; | _ HalfOpenRangePattern_ \
405+ >   ;  ; | _ ObsoleteRangePattern_
406+ >
407+ > _ InclusiveRangePattern_ :\
408+ >   ;  ;   ;  ; _ RangePatternBound_ ` ..= ` _ RangePatternBound_
409+ >
410+ > _ HalfOpenRangePattern_ :\
405411>   ;  ; | _ RangePatternBound_ ` .. `
406412>
407413> _ ObsoleteRangePattern_ :\
@@ -421,12 +427,14 @@ it matches all the values between and including both of its bounds. A range patt
421427half-open is written with a lower bound but not an upper bound, and matches any value equal to
422428or greater than the specified lower bound.
423429
424- For example, a pattern ` 'm'..='p' ` will match only the values ` 'm' ` , ` 'n' ` , ` 'o' ` , and ` 'p' ` . The
430+ For example, a pattern ` 'm'..='p' ` will match only the values ` 'm' ` , ` 'n' ` , ` 'o' ` , and ` 'p' ` . For an integer the
425431pattern ` 1.. ` will match 9, or 9001, or 9007199254740991 (if it is of an appropriate size), but
426- not 0 or negative numbers for signed integers. The bounds can be literals or paths that point
432+ not 0, and not negative numbers for signed integers. The bounds can be literals or paths that point
427433to constant values.
428434
429- A pattern a ` ..= ` b must always have a &le ; b. It is an error to have a range pattern
435+ A half-open range pattern in the style ` a.. ` cannot be used to match within the context of a slice.
436+
437+ A pattern ` a..=b ` must always have a &le ; b. It is an error to have a range pattern
430438` 10..=0 ` , for example.
431439
432440The ` ... ` syntax is kept for backwards compatibility.
@@ -734,6 +742,10 @@ is irrefutable. When matching a slice, it is irrefutable only in the form with
734742a single ` .. ` [ rest pattern] ( #rest-patterns ) or [ identifier
735743pattern] ( #identifier-patterns ) with the ` .. ` rest pattern as a subpattern.
736744
745+ Within a slice, a half-open range pattern like ` a.. ` must be enclosed in parentheses,
746+ as in ` (a..) ` , to clarify it is intended to match a single value.
747+ A future version of Rust may give the non-parenthesized version an alternate meaning.
748+
737749## Path patterns
738750
739751> ** <sup >Syntax</sup >** \
0 commit comments