Skip to content

Tracking issue for lazy type aliases #112792

Open
@GuillaumeGomez

Description

@GuillaumeGomez

This is a tracking issue for the feature lazy type aliases.
It's considered to be a “sophisticated bug fix” for #15823 and #21903, hence no RFC.
The feature gate for the issue is #![feature(lazy_type_alias)].

The feature implements the expected semantics for type aliases:

  • Where-clauses and bounds on type parameters of type aliases are enforced.
  • Type aliases are checked for well-formedness.
  • Where-clauses are trailing instead of leading [just like they are for associated types][https://github.com/Proposal: Change syntax of where clauses on type aliases #89122].
  • Privacy: Private type aliases cannot be used in public signatures anymore,
    the type alias must also be made public (see also #114213).

It can only be stabilized as part of a new edition since the new semantics are incompatible with the status quo.

The core idea (weak alias types) was originally proposed in MCP 504.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved questions

None.

Resolved questions

  • We currently don't imply any outlives-bounds on lazy type aliases to prevent introducing unsoundness which as it stands implied bounds would theoretically bring along. With this in mind, when is the best time to add implied bounds to lazy type aliases?

Implementation history

Honorable Mentions


Thanks to @fmease for writing this description. :)

Metadata

Metadata

Assignees

Labels

A-maybe-future-editionSomething we may consider for a future edition.B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-lazy_type_alias`#![feature(lazy_type_alias)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.S-tracking-needs-migration-lintStatus: This item needs a migration lint.T-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

Status

Implementation

Status

Fixed By

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions