Skip to content

CoerceUnsized builtin checks do not handle aliases #135214

Closed
@BoxyUwU

Description

@BoxyUwU
          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)

Metadata

Metadata

Labels

A-coercionsArea: implicit and explicit `expr as Type` coercionsF-derive_coerce_pointeeFeature: RFC 3621's oft-renamed implementationT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions