Skip to content
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

CoerceUnsized builtin checks do not handle aliases #135214

Open
BoxyUwU opened this issue Jan 7, 2025 · 0 comments · May be fixed by #135228
Open

CoerceUnsized builtin checks do not handle aliases #135214

BoxyUwU opened this issue Jan 7, 2025 · 0 comments · May be fixed by #135228
Assignees
Labels
A-coercions Area: implicit and explicit `expr as Type` coercions F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 7, 2025

          The `CoerceUnsized` builtin checks that the parameter being unsized is only used in `PhantomData`s and one field does not handle aliases and just directly checks if the `Ty` is a `PhantomData`. This will have to be fixed before stabilizing `lazy_type_alias` so we may as well just handle it from the beginning. See the following two playground examples for things that don't compile but probably ought to before we stabilize any form of user written impls for the trait:

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=35e9d30ae8a278601de5d8a45bc40417
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=850f363579a53b61b88c6b02a502c31b

Originally posted by @BoxyUwU in #133820 (comment)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 7, 2025
@BoxyUwU BoxyUwU added T-types Relevant to the types team, which will review and decide on the PR/issue. F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-coercions Area: implicit and explicit `expr as Type` coercions and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 7, 2025
@compiler-errors compiler-errors self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-coercions Area: implicit and explicit `expr as Type` coercions F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants