Skip to content

Commit 01a7946

Browse files
committed
Document Stabilize exclusive_range_pattern feature
1 parent 412c1b2 commit 01a7946

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

src/changelog.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ Language changes in Rust 1.80.0
3434
* No change: this previous restriction is not specified in the FLS
3535

3636
* `Stabilize `exclusive_range_pattern` feature <https://github.com/rust-lang/rust/pull/124459/>`_
37-
* `Guarantee layout and ABI of `Result` in some scenarios <https://github.com/rust-lang/rust/pull/124870>`_
37+
38+
* Changed syntax: :s:`RangePattern`
39+
40+
* New syntax: :s:`ExclusiveRangePattern`
41+
42+
* Changed paragraph: :p:`fls_8Q6NfRx4j5V7`
43+
44+
* New paragraphs: :p:`fls_3PyquOKjA7SI`, :p:`fls_8bdOqkO1NuJW`, :p:`fls_EDL1Pi56KQ2H`
3845

3946
Language changes in Rust 1.79.0
4047
-------------------------------

src/patterns.rst

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ Range Patterns
433433
RangePattern ::=
434434
HalfOpenRangePattern
435435
| InclusiveRangePattern
436+
| ExclusiveRangePattern
436437
| ObsoleteRangePattern
437438
438439
HalfOpenRangePattern ::=
@@ -441,6 +442,9 @@ Range Patterns
441442
InclusiveRangePattern ::=
442443
RangePatternLowBound $$..=$$ RangePatternHighBound
443444

445+
ExclusiveRangePattern ::=
446+
RangePatternLowBound $$..$$ RangePatternHighBound
447+
444448
ObsoleteRangePattern ::=
445449
RangePatternLowBound $$...$$ RangePatternHighBound
446450

@@ -471,6 +475,10 @@ A :t:`half-open range pattern` is a :t:`range pattern` with only a
471475
An :t:`inclusive range pattern` is a :t:`range pattern` with both a
472476
:t:`range pattern low bound` and a :t:`range pattern high bound`.
473477

478+
:dp:`fls_3PyquOKjA7SI`
479+
An :t:`exclusive range pattern` is a :t:`range pattern` with both a
480+
:t:`range pattern low bound` and a :t:`range pattern high bound`.
481+
474482
:dp:`fls_akf9x5r6e0ta`
475483
An :t:`obsolete range pattern` is a :t:`range pattern` that uses obsolete syntax
476484
to express an :t:`inclusive range pattern`.
@@ -494,6 +502,10 @@ when the context is a :t:`slice pattern`.
494502
The :t:`range pattern low bound` of an :t:`inclusive range pattern` shall be
495503
less than or equal to its :t:`range pattern high bound`.
496504

505+
:dp:`fls_8bdOqkO1NuJW`
506+
The :t:`range pattern low bound` of an :t:`exclusive range pattern` shall be
507+
less than to its :t:`range pattern high bound`.
508+
497509
:dp:`fls_s2b5n4snc4d7`
498510
An :t:`obsolete range pattern` is equivalent to an :t:`inclusive range pattern`.
499511

@@ -508,11 +520,11 @@ The :t:`[type]s` of the :t:`range pattern low bound` and the
508520
:dp:`fls_3js1645tgh31`
509521
The :t:`type` of a :t:`range pattern` is determined as follows:
510522

511-
* :dp:`fls_wfqrbwrogjnq`
512-
If the :t:`range pattern` is expressed as an :t:`inclusive range pattern` or
513-
an :t:`obsolete range pattern`, then the :t:`type` is the :t:`unified type` of
514-
the :t:`[type]s` of the :t:`range pattern low bound` and the
515-
:t:`range pattern high bound`.
523+
* :dp:`fls_8Q6NfRx4j5V7`
524+
If the :t:`range pattern` is expressed as an :t:`inclusive range pattern`, an
525+
:t:`exclusive range pattern`, or an :t:`obsolete range pattern`, then the
526+
:t:`type` is the :t:`unified type` of the :t:`[type]s` of the
527+
:t:`range pattern low bound` and the :t:`range pattern high bound`.
516528

517529
* :dp:`fls_rgr7t33s0m7m`
518530
Otherwise the :t:`type` is the :t:`type` of the :t:`range pattern low bound`.
@@ -1423,6 +1435,12 @@ Range Pattern Matching
14231435
the inclusive range from the :t:`range pattern low bound` to the
14241436
:t:`range pattern high bound`, then matching succeeds.
14251437

1438+
#. :dp:`fls_EDL1Pi56KQ2H`
1439+
If the :t:`range pattern` is expressed as an :t:`exclusive range pattern`
1440+
and the context :t:`value` is in the exclusive range from the
1441+
:t:`range pattern low bound` to the :t:`range pattern high bound`, then
1442+
matching succeeds.
1443+
14261444
#. :dp:`fls_n4t3xah1pk7i`
14271445
Otherwise matching fails.
14281446

0 commit comments

Comments
 (0)