about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-22 21:59:27 +0100
committerGitHub <noreply@github.com>2024-12-22 21:59:27 +0100
commitc16f00cff667533ea279ab03d2067d63cb1e9eab (patch)
treea48ec043bf5ad75fe8fa043c473de5231b01c4fe /compiler/rustc_mir_transform/src
parente86874f8070be691d1efae2a3b83da58bb203071 (diff)
parent5c04151c6cea29398b786b3fa781ec2f8f5ed1da (diff)
downloadrust-c16f00cff667533ea279ab03d2067d63cb1e9eab.tar.gz
rust-c16f00cff667533ea279ab03d2067d63cb1e9eab.zip
Rollup merge of #134642 - kpreid:pointerlike-cell, r=compiler-errors
Implement `PointerLike` for `isize`, `NonNull`, `Cell`, `UnsafeCell`, and `SyncUnsafeCell`.

* Implementing `PointerLike` for `UnsafeCell` enables the possibility of interior mutable `dyn*` values. Since this means potentially exercising new codegen behavior, I added a test for it in `tests/ui/dyn-star/cell.rs`. Please let me know if there are further sorts of tests that should be written, or other care that should be taken with this change.

  It is unfortunately not possible without compiler changes to implement `PointerLike` for `Atomic*` types, since they are not `repr(transparent)` (and, in theory if not in practice, `AtomicUsize`'s alignment may be greater than that of an ordinary pointer or `usize`).

* Implementing `PointerLike` for `NonNull` is useful for pointer types which wrap `NonNull`.

* Implementing `PointerLike` for `isize` is just for completeness; I have no use cases in mind, but I cannot think of any reason not to do this.

* Tracking issue: #102425

`@rustbot` label +F-dyn_star
(there is no label or tracking issue for F-pointer_like_trait)
Diffstat (limited to 'compiler/rustc_mir_transform/src')
0 files changed, 0 insertions, 0 deletions