Skip to content

Commit

Permalink
explicitly say that we are assuming post-desugaring place expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 19, 2023
1 parent 10adc2b commit f12e637
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/behavior-considered-undefined.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ type. (If there is no `*` projection in the place expression, then this is
accessing the field of a local and rustc will guarantee proper alignment. If
there are multiple `*` projection, then each of them incurs a load of the
pointer-to-be-dereferenced itself from memory, and each of these loads is
subject to the alignment constraint.)
subject to the alignment constraint. Note that some `*` projections can be
omitted in surface Rust syntax due to automatic dereferencing; we are
considering the fully expanded place expression here.)

For instance, if `ptr` has type `*const S` where `S` has an alignment of 8, then
`ptr` must be 8-aligned or else `(*ptr).f` is "based on an misaligned pointer".
Expand Down

0 comments on commit f12e637

Please sign in to comment.