Skip to content

Conversation

zylthinking
Copy link

No description provided.


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".
`*ptr` must be 8-aligned or else `(*ptr).f` is "based on an misaligned pointer".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`*ptr` must be 8-aligned or else `(*ptr).f` is "based on an misaligned pointer".
the address contained in `ptr` must be cleanly divisible by 8 or else `(*ptr).f` is "based on an misaligned pointer".

On the rustdocs call today we spent a lot of time trying to determine whether or not this was correct or an improvement. Maybe there's a better way to say this more explicitly that relies less on notation?

The ambiguity all comes from whether we're talking about where the pointer is stored or whether we're talking about the address contained in the pointer.

@ehuss ehuss added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants