rust/tests/ui/dyn-star
Matthias Krüger c16f00cff6
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)
2024-12-22 21:59:27 +01:00
..
auxiliary Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
align.normal.stderr
align.over_aligned.stderr
align.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
async-block-dyn-star.rs Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
async-block-dyn-star.stderr Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
box.rs Ignore tests w/ current/next revisions from compare-mode=next-solver 2024-03-10 21:18:41 -04:00
cell.rs Implement PointerLike for isize, NonNull, Cell, UnsafeCell, and SyncUnsafeCell. 2024-12-22 11:18:56 -08:00
check-size-at-cast-polymorphic-bad.current.stderr Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
check-size-at-cast-polymorphic-bad.next.stderr Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
check-size-at-cast-polymorphic-bad.rs Ignore tests w/ current/next revisions from compare-mode=next-solver 2024-03-10 21:18:41 -04:00
check-size-at-cast-polymorphic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
check-size-at-cast.rs
check-size-at-cast.stderr
const-and-static.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-and-static.stderr
const.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dispatch-on-pin-mut.rs Stabilize noop_waker 2024-12-05 14:14:17 -08:00
dispatch-on-pin-mut.run.stdout
dispatch-on-pin-mut.stderr
dont-unsize-coerce-dyn-star.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-unsize-coerce-dyn-star.run.stdout
dont-unsize-coerce-dyn-star.stderr
drop.rs Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
drop.run.stdout
dyn-async-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dyn-pointer-like.rs unimplement PointerLike for trait objects 2024-12-20 17:35:29 +01:00
dyn-pointer-like.stderr unimplement PointerLike for trait objects 2024-12-20 17:35:29 +01:00
dyn-star-to-dyn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dyn-star-to-dyn.stderr
dyn-to-rigid.rs unify dyn* coercions with other pointer coercions 2024-09-24 22:17:55 +02:00
dyn-to-rigid.stderr unify dyn* coercions with other pointer coercions 2024-09-24 22:17:55 +02:00
enum-cast.rs Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
error.rs Implement PointerLike for isize, NonNull, Cell, UnsafeCell, and SyncUnsafeCell. 2024-12-22 11:18:56 -08:00
error.stderr Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
feature-gate-dyn_star.rs
feature-gate-dyn_star.stderr
float-as-dyn-star.rs Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
float-as-dyn-star.stderr Implement PointerLike for isize, NonNull, Cell, UnsafeCell, and SyncUnsafeCell. 2024-12-22 11:18:56 -08:00
gated-span.rs
gated-span.stderr
illegal.rs Don't ICE on illegal dyn* casts 2024-12-21 23:43:52 +00:00
illegal.stderr Don't ICE on illegal dyn* casts 2024-12-21 23:43:52 +00:00
issue-102430.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
make-dyn-star.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
method.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
no-explicit-dyn-star-cast.rs
no-explicit-dyn-star-cast.stderr
no-explicit-dyn-star.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
no-explicit-dyn-star.stderr
no-implicit-dyn-star.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
no-implicit-dyn-star.stderr Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
no-unsize-coerce-dyn-trait.rs Revert "Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin" 2024-01-22 14:24:31 +00:00
no-unsize-coerce-dyn-trait.stderr Revert "Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin" 2024-01-22 14:24:31 +00:00
param-env-region-infer.current.stderr Fix test problems discovered by the revision check 2024-05-09 14:47:09 +10:00
param-env-region-infer.rs Fix test problems discovered by the revision check 2024-05-09 14:47:09 +10:00
pointer-like-impl-rules.rs Explain why a type is not eligible for impl PointerLike. 2024-12-20 20:49:09 -08:00
pointer-like-impl-rules.stderr Explain why a type is not eligible for impl PointerLike. 2024-12-20 20:49:09 -08:00
return.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
return.stderr
syntax.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
thin.next.stderr fix metadata for dyn-star in new solver 2024-03-10 20:24:00 +01:00
thin.old.stderr fix metadata for dyn-star in new solver 2024-03-10 20:24:00 +01:00
thin.rs fix metadata for dyn-star in new solver 2024-03-10 20:24:00 +01:00
union.rs
union.stderr
unsize-into-ref-dyn-star.rs
unsize-into-ref-dyn-star.stderr
upcast.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
upcast.stderr Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00