Can't cast a pointer of a trait object newtype to a pointer of that trait object. #128625
Labels
A-raw-pointers
Area: raw pointers, MaybeUninit, NonNull
A-trait-objects
Area: trait objects, vtable layout
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I expected the code to compile. Instead, I got the following error, where it appears that the compiler is trying to do an unsize coercion and failing:
Of note, the following code compiles fine:
Probably related to #128621
Meta
This issue reproduces on the playground on stable (1.80.0), and nightly (2024-08-02 fd8d6fb).
The text was updated successfully, but these errors were encountered: