From f59e3c82cab461613d3379e6f5816a15956d3a36 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 9 Sep 2024 10:40:36 +0200 Subject: [PATCH 1/5] Update changelog for 1.80.0 --- src/changelog.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/changelog.rst b/src/changelog.rst index dc0ff4bb..651a55d9 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -18,6 +18,15 @@ with the change that has been applied due to it. just the language changes that had an impact to the FLS. See the `release notes`_ for a full list of changes. +Language changes in Rust 1.80.0 +------------------------------- + +* `Document maximum allocation size `_ +* `Allow zero-byte offsets and ZST read/writes on arbitrary pointers `_ +* `Support C23's variadics without a named parameter `_ +* `Stabilize `exclusive_range_pattern` feature `_ +* `Guarantee layout and ABI of `Result` in some scenarios `_ + Language changes in Rust 1.79.0 ------------------------------- From e695004a310e05369f1e3d0f5ecf056380203a1c Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 9 Sep 2024 10:35:40 +0200 Subject: [PATCH 2/5] Document maximum allocation size --- src/changelog.rst | 3 +++ src/values.rst | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/changelog.rst b/src/changelog.rst index 651a55d9..6ed007b1 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -22,6 +22,9 @@ Language changes in Rust 1.80.0 ------------------------------- * `Document maximum allocation size `_ + + * New paragraphs: :p:`fls_CUJyMj0Sj8NS`, :p:`fls_kaomYy0Ml4Nh`, :p:`fls_B5cmkWfD5GNt`, :p:`fls_oqhQ62mDLckN`, :p:`fls_uhwpuv6cx4ip`, :p:`fls_xuuFKmm181bs` + * `Allow zero-byte offsets and ZST read/writes on arbitrary pointers `_ * `Support C23's variadics without a named parameter `_ * `Stabilize `exclusive_range_pattern` feature `_ diff --git a/src/values.rst b/src/values.rst index f3849f8c..76c8a60c 100644 --- a/src/values.rst +++ b/src/values.rst @@ -14,6 +14,17 @@ Values A :t:`value` is either a :t:`literal` or the result of a computation, that may be stored in a memory location, and interpreted based on some :t:`type`. +:dp:`fls_CUJyMj0Sj8NS` +An :dt:`allocated object` is a :t:`value` stored at some memory address. + +:dp:`fls_kaomYy0Ml4Nh` +An :t:`[allocated object]s` :dt:`base address` is the the memory address the +object is stored. + +:dp:`fls_B5cmkWfD5GNt` +An :t:`[allocated object]s` :dt:`memory size` is the number of bytes the object +spans in memory from its :t:`base address`. + :dp:`fls_rixdyyc525xp` Two :t:`[value]s` :t:`overlap` when @@ -37,6 +48,20 @@ Two :t:`[value]s` :t:`overlap` when It is undefined behavior to create a :t:`value` from uninitialized memory unless the :t:`type` of the :t:`value` is a :t:`union type`. +:dp:`fls_oqhQ62mDLckN` +It is undefined behavior to create an :t:`allocated object` at :t:`base address` +:c:`null`. + +:dp:`fls_uhwpuv6cx4ip` +It is undefined behavior to create an :t:`allocated object` with :t:`memory +size` ``size`` at a :t:`base address` ``base`` where ``base + size`` is greater +than the architectures maximum :c:`usize` value. + +:dp:`fls_xuuFKmm181bs` +It is undefined behavior to create an :t:`allocated object` with :t:`memory +size` ``size`` where ``size`` is greater than the architectures maximum +:c:`isize` value. + .. _fls_ixjc5jaamx84: Constants From 1368b80aad4f4bc35c560c14e403c2db9f31b77e Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 9 Sep 2024 10:44:59 +0200 Subject: [PATCH 3/5] Document Allow zero-byte offsets and ZST read/writes on arbitrary pointers --- src/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/changelog.rst b/src/changelog.rst index 6ed007b1..97927755 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -26,6 +26,9 @@ Language changes in Rust 1.80.0 * New paragraphs: :p:`fls_CUJyMj0Sj8NS`, :p:`fls_kaomYy0Ml4Nh`, :p:`fls_B5cmkWfD5GNt`, :p:`fls_oqhQ62mDLckN`, :p:`fls_uhwpuv6cx4ip`, :p:`fls_xuuFKmm181bs` * `Allow zero-byte offsets and ZST read/writes on arbitrary pointers `_ + + * No change: this previous restriction is not specified in the FLS + * `Support C23's variadics without a named parameter `_ * `Stabilize `exclusive_range_pattern` feature `_ * `Guarantee layout and ABI of `Result` in some scenarios `_ From 412c1b20fa655e6f91258f7fe4ca66a7566593cf Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 9 Sep 2024 10:47:21 +0200 Subject: [PATCH 4/5] Document Support C23's variadics without a named parameter --- src/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/changelog.rst b/src/changelog.rst index 97927755..4fc06999 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -30,6 +30,9 @@ Language changes in Rust 1.80.0 * No change: this previous restriction is not specified in the FLS * `Support C23's variadics without a named parameter `_ + + * No change: this previous restriction is not specified in the FLS + * `Stabilize `exclusive_range_pattern` feature `_ * `Guarantee layout and ABI of `Result` in some scenarios `_ From 01a7946a0b9711440dbc263f8164bdfe66249464 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 9 Sep 2024 10:48:43 +0200 Subject: [PATCH 5/5] Document Stabilize `exclusive_range_pattern` feature --- src/changelog.rst | 9 ++++++++- src/patterns.rst | 28 +++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/changelog.rst b/src/changelog.rst index 4fc06999..6327b484 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -34,7 +34,14 @@ Language changes in Rust 1.80.0 * No change: this previous restriction is not specified in the FLS * `Stabilize `exclusive_range_pattern` feature `_ -* `Guarantee layout and ABI of `Result` in some scenarios `_ + + * Changed syntax: :s:`RangePattern` + + * New syntax: :s:`ExclusiveRangePattern` + + * Changed paragraph: :p:`fls_8Q6NfRx4j5V7` + + * New paragraphs: :p:`fls_3PyquOKjA7SI`, :p:`fls_8bdOqkO1NuJW`, :p:`fls_EDL1Pi56KQ2H` Language changes in Rust 1.79.0 ------------------------------- diff --git a/src/patterns.rst b/src/patterns.rst index c4317bf6..4c8fe97c 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_3PyquOKjA7SI` +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_8bdOqkO1NuJW` +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`. @@ -508,11 +520,11 @@ The :t:`[type]s` of the :t:`range pattern low bound` and the :dp:`fls_3js1645tgh31` 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`. +* :dp:`fls_8Q6NfRx4j5V7` + 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_EDL1Pi56KQ2H` + 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.