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

Register: document provenance, fix conversion implementations. #563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrvanwhy
Copy link
Collaborator

@jrvanwhy jrvanwhy commented Nov 13, 2024

Now that the presence of provenance in Rust has been stabilized, we should document the effect that Register has on pointer provenance. Note that the current implementation sometimes attaches provenance when we don't want it to, which we can only fix when strict provenance is stabilized (which should happen in Rust 1.84).

This also fixes the implementation of From<usize> for Register, which relies on transmuting a usize to a pointer, which is not a stable guarantee, and makes a few other style improvements.

Now that the presence of provenance in Rust has been stabilized, we should document the effect that `Register` has on pointer provenance. Note that the current implementation sometimes attaches provenance when we don't want it to, which we can only fix when strict provenance is stabilized (which should happen in Rust 1.84).

This also fixes the implementation of `From<usize> for Register`, which relies on transmuting a usize to a pointer, which [is not a stable guarantee](https://github.com/rust-lang/rust/blob/81eef2d362a6f03db6f8928f82d94298d31eb81b/library/core/src/ptr/mod.rs#L640).
@jrvanwhy jrvanwhy added the upkeep Indicates a PR is upkeep as defined by the code review policy. label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep Indicates a PR is upkeep as defined by the code review policy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant