Skip to content

Forbid unusable type aliases #22434

Closed
Closed
@Stebalien

Description

@Stebalien

As far as I can tell, the following type alias is unusable:

type I<'a> = &'a (Iterator + 'a);

This isn't a complete type because Iterator::Item is unspecified and isn't usable because there is no way to specify Iterator::Item (as far as I know) after the fact.

Personally, I feel type aliases like this should be compile time errors. I'm bringing this nitpick up now because fixing it is technically a breaking change .

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)A-type-systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions