diff --git a/src/changelog.rst b/src/changelog.rst index 09c9ae55..285cfa17 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -33,6 +33,13 @@ Language changes in Rust 1.95.0 - The target is outside the scope of the FLS. - `const-eval: be more consistent in the behavior of padding during typed copies `_ + + New paragraphs: + + - :p:`fls_LmPbrh0Cba8g` + - :p:`fls_nwgIMLkvD2Ol` + - :p:`fls_hOIImCr1c6IF` + - `Const blocks are no longer evaluated to determine if expressions involving fallible operations can implicitly be constant-promoted `_ - `Make operational semantics of pattern matching independent of crate and module `_ diff --git a/src/expressions.rst b/src/expressions.rst index 848fb111..3c85d797 100644 --- a/src/expressions.rst +++ b/src/expressions.rst @@ -341,6 +341,11 @@ control reaches the invocation of :t:`macro` :std:`core::panic`. It is a static error if the evaluation of a :t:`constant expression` results in a :t:`value` that is unaligned. +.. rubric:: Undefined Behavior + +:dp:`fls_hOIImCr1c6IF` +It is undefined behavior to convert a :t:`pointer` that has :t:`provenance` into a non-:t:`pointer type` in a :t:`constant context`. + .. rubric:: Dynamic Semantics :dp:`fls_tg0kya5125jt` diff --git a/src/values.rst b/src/values.rst index 68c27eb5..83f351eb 100644 --- a/src/values.rst +++ b/src/values.rst @@ -111,6 +111,12 @@ The :t:`expression` of a :t:`constant initializer` shall be a The value of a :t:`constant` is determined by evaluating its :t:`constant initializer`. +:dp:`fls_LmPbrh0Cba8g` +The :t:`type representation` of the :t:`value` of a :t:`constant initializer` or :t:`static initializer` must only contain bytes with :t:`provenance` where all bytes of some original :t:`pointer` are in the correct order. + +:dp:`fls_nwgIMLkvD2Ol` +:dt:`Provenance` is the memory that a :t:`pointer` has permission to access, the timespan during which it can acesss that memory, and if it can access the memory for writes. + .. rubric:: Dynamic Semantics :dp:`fls_xezt9hl069h4`