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

[pointer][transmute] Support generic TransmuteFrom #1965

Open
wants to merge 3 commits into
base: I1ac2ae177a235083e33b09fc848423220d3da042
Choose a base branch
from

Commits on Oct 22, 2024

  1. [pointer][transmute] Migrate from util

    This prepares us to rename `TransparentWrapper` to `TransmuteFrom`,
    which we'll do in a follow-up commit to preserve nice git diffs.
    
    Makes progress on #1122
    
    gherrit-pr-id: Ifc49755af0d90eeefe7822d755d508403c266bda
    joshlf committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    244bef4 View commit details
    Browse the repository at this point in the history
  2. [pointer][invariant] Remove AliasingMapping, Inaccessible

    We previously used `AliasingMapping`s and `Inaccessible` to model
    `UnsafeCell` agreement. This abuses the notion of a mapping since one
    doesn't ever actually want to change the aliasing of a pointer (and
    certainly not to `Inaccessible`) - really this was meant to model
    pointer casts which should never be performed. In addition to being an
    awkward fit, the presence of `Inaccessible` meant that code could not
    assume that any `Aliasing` invariant permitted reading, and so we had to
    add extra machinery to work around this.
    
    Future commits will use a different, simpler model for denoting
    `UnsafeCell` agreement or disagreement.
    
    While we're here, make `Read` slightly more permissive, implemented for
    `A: Aliasing, T: Immutable` rather than just `A: Reference, T:
    Immutable`.
    
    Makes progress on #1122, #1866
    
    gherrit-pr-id: I1ac2ae177a235083e33b09fc848423220d3da042
    joshlf committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    dbf871e View commit details
    Browse the repository at this point in the history
  3. [pointer][transmute] Support generic TransmuteFrom

    This commit replaces the `TransparentWrapper` trait with a more generic,
    bidirectional `TransmuteFrom<T>` trait. `U: TransmuteFrom<T>` indicates
    that `T` and `U` have the same sizes and that `T` can be transmuted into
    `U` given certain alignment and validity invariant mappings.
    
    Makes progress on #1122
    
    gherrit-pr-id: I3a6abe00c9220431e60f9beee68e472d323b5612
    joshlf committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    faf05b1 View commit details
    Browse the repository at this point in the history