Skip to content

Unsized coercion of TyCtor(T) clarity issue #1258

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

Open
gdennie opened this issue Aug 29, 2022 · 1 comment
Open

Unsized coercion of TyCtor(T) clarity issue #1258

gdennie opened this issue Aug 29, 2022 · 1 comment

Comments

@gdennie
Copy link

gdennie commented Aug 29, 2022

In type-coercions.md, the following is really not clear:

* TyCtor(`T`) to TyCtor(`U`), where TyCtor(`T`) is one of
    - `&T`
    - `&mut T`
    - `*const T`
    - `*mut T`
    - `Box<T>`

    and where `U` can be obtained from `T` by [unsized coercion](#unsized-coercions).

    <!--In the future, coerce_inner will be recursively extended to tuples and
    structs. In addition, coercions from subtraits to supertraits will be
    added. See [RFC 401] for more details.-->

Ideally, the text should not require deciphering. It seems to be redundantly stating that &T can be coerced to &U. However, is it merely stating that &, &mut, *const, *mut, and Box have special permissibility when unsized coercions exists for their argument types.

@steffahn
Copy link
Member

steffahn commented Sep 18, 2022

I feel like this whole bullet point might have simply become seriously outdated, because it appears to describe some (but not all) of the coercions that now work via CoerceUnsized. Here’s some relevant forum discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants