Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move rule to dynamic semantics #509

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3525,15 +3525,6 @@ Writing to the :t:`selected field` of a :t:`union` where the :t:`type` of the
:t:`selected field` implements the :std:`core::marker::Copy` :t:`trait` or the
:std:`core::mem::ManuallyDrop` :t:`trait` shall not require :t:`unsafe context`.

:dp:`fls_t6xmsm2nk1bc`
Writing to and then reading from the :t:`selected field` of a :t:`union`
subject to :t:`attribute` :c:`repr` is equivalent to invoking :t:`function`
``core::mem::transmute<write_type, read_type>(field_bits)`` where ``write_type``
is the :t:`type` used at the time of writing the :t:`selected field`,
``read_type`` is the :t:`type` used at the time of reading the
:t:`selected field`, and ``field_bits`` is the bit representation of the
:t:`selected field`.

:dp:`fls_jjnyuU9KIaGy`
A :t:`field access expression` is subject to :t:`field resolution`.

Expand All @@ -3546,6 +3537,15 @@ field`'s type.

.. rubric:: Dynamic Semantics

:dp:`fls_t6xmsm2nk1bc`
Writing to and then reading from the :t:`selected field` of a :t:`union`
subject to :t:`attribute` :c:`repr` is equivalent to invoking :t:`function`
``core::mem::transmute<write_type, read_type>(field_bits)`` where ``write_type``
is the :t:`type` used at the time of writing the :t:`selected field`,
``read_type`` is the :t:`type` used at the time of reading the
:t:`selected field`, and ``field_bits`` is the bit representation of the
:t:`selected field`.

:dp:`fls_6uzouesw2sod`
The :t:`evaluation` of a :t:`field access expression` evaluates its
:t:`container operand`.
Expand Down
Loading