diff --git a/src/changelog.rst b/src/changelog.rst index 4fc06999..fc3e9402 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -34,6 +34,13 @@ Language changes in Rust 1.80.0 * No change: this previous restriction is not specified in the FLS * `Stabilize `exclusive_range_pattern` feature `_ + + * Changed syntax: :s:`RangePattern` + + * New syntax: :s:`ExclusiveRangePattern` + + * New paragraphs: :p:`fls_3PyquOKjA7SI`, :p:`fls_8Q6NfRx4j5V7`, :p:`fls_8Q6NfRx4j5V7`, :p:`fls_EDL1Pi56KQ2H` + * `Guarantee layout and ABI of `Result` in some scenarios `_ Language changes in Rust 1.79.0 diff --git a/src/patterns.rst b/src/patterns.rst index c4317bf6..963be197 100644 --- a/src/patterns.rst +++ b/src/patterns.rst @@ -433,6 +433,7 @@ Range Patterns RangePattern ::= HalfOpenRangePattern | InclusiveRangePattern + | ExclusiveRangePattern | ObsoleteRangePattern HalfOpenRangePattern ::= @@ -441,6 +442,9 @@ Range Patterns InclusiveRangePattern ::= RangePatternLowBound $$..=$$ RangePatternHighBound + ExclusiveRangePattern ::= + RangePatternLowBound $$..$$ RangePatternHighBound + ObsoleteRangePattern ::= RangePatternLowBound $$...$$ RangePatternHighBound @@ -471,6 +475,10 @@ A :t:`half-open range pattern` is a :t:`range pattern` with only a An :t:`inclusive range pattern` is a :t:`range pattern` with both a :t:`range pattern low bound` and a :t:`range pattern high bound`. +:dp:`fls_q86j23iiqv8w` +An :t:`exclusive range pattern` is a :t:`range pattern` with both a +:t:`range pattern low bound` and a :t:`range pattern high bound`. + :dp:`fls_akf9x5r6e0ta` An :t:`obsolete range pattern` is a :t:`range pattern` that uses obsolete syntax to express an :t:`inclusive range pattern`. @@ -494,6 +502,10 @@ when the context is a :t:`slice pattern`. The :t:`range pattern low bound` of an :t:`inclusive range pattern` shall be less than or equal to its :t:`range pattern high bound`. +:dp:`fls_9kk81isk0mlp` +The :t:`range pattern low bound` of an :t:`exclusive range pattern` shall be +less than to its :t:`range pattern high bound`. + :dp:`fls_s2b5n4snc4d7` An :t:`obsolete range pattern` is equivalent to an :t:`inclusive range pattern`. @@ -509,10 +521,10 @@ The :t:`[type]s` of the :t:`range pattern low bound` and the The :t:`type` of a :t:`range pattern` is determined as follows: * :dp:`fls_wfqrbwrogjnq` - If the :t:`range pattern` is expressed as an :t:`inclusive range pattern` or - an :t:`obsolete range pattern`, then the :t:`type` is the :t:`unified type` of - the :t:`[type]s` of the :t:`range pattern low bound` and the - :t:`range pattern high bound`. + If the :t:`range pattern` is expressed as an :t:`inclusive range pattern`, an + :t:`exclusive range pattern`, or an :t:`obsolete range pattern`, then the + :t:`type` is the :t:`unified type` of the :t:`[type]s` of the + :t:`range pattern low bound` and the :t:`range pattern high bound`. * :dp:`fls_rgr7t33s0m7m` Otherwise the :t:`type` is the :t:`type` of the :t:`range pattern low bound`. @@ -1423,6 +1435,12 @@ Range Pattern Matching the inclusive range from the :t:`range pattern low bound` to the :t:`range pattern high bound`, then matching succeeds. +#. :dp:`fls_7nxkgls0a5os` + If the :t:`range pattern` is expressed as an :t:`exclusive range pattern` + and the context :t:`value` is in the exclusive range from the + :t:`range pattern low bound` to the :t:`range pattern high bound`, then + matching succeeds. + #. :dp:`fls_n4t3xah1pk7i` Otherwise matching fails.