Skip to content

Unsized coercion of TyCtor(T) clarity issue #1258

Open
@gdennie

Description

@gdennie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions