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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
align.over_aligned.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
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 Enforce that PointerLike requires a pointer-like ABI 2023-04-08 21:11:16 +00:00
check-size-at-cast.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-and-static.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-and-static.stderr dyn* is a valid const 2023-04-04 00:28:05 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dispatch-on-pin-mut.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dont-unsize-coerce-dyn-star.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
drop.rs Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
drop.run.stdout Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Allow codegen to unsize dyn* to dyn 2023-01-11 19:52:42 +00:00
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 Gate all usages of dyn*, even in macros 2023-03-11 21:29:28 +00:00
feature-gate-dyn_star.stderr Bless tests 2024-01-13 12:46:58 -05:00
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 Gate all usages of dyn*, even in macros 2023-03-11 21:29:28 +00:00
gated-span.stderr Bless tests 2024-01-13 12:46:58 -05:00
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 Gate all usages of dyn*, even in macros 2023-03-11 21:29:28 +00:00
no-explicit-dyn-star-cast.stderr Bless tests 2024-01-13 12:46:58 -05:00
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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Unions are not PointerLike 2024-01-07 19:28:00 +00:00
union.stderr Unions are not PointerLike 2024-01-07 19:28:00 +00:00
unsize-into-ref-dyn-star.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unsize-into-ref-dyn-star.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
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