-
Couldn't load subscription status.
- Fork 128
[pointer][transmute] Support generic TransmuteFrom #1910
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
base: Ifc49755af0d90eeefe7822d755d508403c266bda
Are you sure you want to change the base?
[pointer][transmute] Support generic TransmuteFrom #1910
Conversation
99a8250 to
19f7378
Compare
3b9ac7b to
c88e77f
Compare
19f7378 to
140f430
Compare
c88e77f to
c3a2206
Compare
140f430 to
ac39cec
Compare
c3a2206 to
7643459
Compare
ac39cec to
41cd8a9
Compare
41cd8a9 to
90c2f64
Compare
90c2f64 to
65c71f6
Compare
7643459 to
b36cb1c
Compare
65c71f6 to
a1fc228
Compare
b36cb1c to
4bd33fb
Compare
a6e7783 to
af10d3d
Compare
af10d3d to
235702a
Compare
ac629d9 to
53deb0a
Compare
235702a to
f0fc37e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## I1ac2ae177a235083e33b09fc848423220d3da042 #1910 +/- ##
============================================================================
Coverage ? 89.76%
============================================================================
Files ? 17
Lines ? 5806
Branches ? 0
============================================================================
Hits ? 5212
Misses ? 594
Partials ? 0 ☔ View full report in Codecov by Sentry. |
f0fc37e to
9b71dc8
Compare
53deb0a to
4795dcd
Compare
9b71dc8 to
1bee133
Compare
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
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
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: I7af68cdaa5ea47ab245a942d1cbd8bc5e6407223
4795dcd to
94165e5
Compare
1bee133 to
4ea2f82
Compare
33fc89f to
48f1450
Compare
48f1450 to
355531d
Compare
d89fa0f to
08771d7
Compare
2b2f66a to
34eb2a3
Compare
This commit replaces the
TransparentWrappertrait with a more generic,bidirectional
TransmuteFrom<T>trait.U: TransmuteFrom<T>indicatesthat
TandUhave the same sizes and thatTcan be transmuted intoUgiven certain alignment and validity invariant mappings.Makes progress on #1122
This PR is on branch ptr-overhaul.