Skip to content
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

Tracking issue for lazy type aliases #112792

Open
1 of 6 tasks
GuillaumeGomez opened this issue Jun 19, 2023 · 5 comments
Open
1 of 6 tasks

Tracking issue for lazy type aliases #112792

GuillaumeGomez opened this issue Jun 19, 2023 · 5 comments
Assignees
Labels
A-maybe-future-edition Something we may consider for a future edition. B-unstable Feature: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-lazy_type_alias `#![feature(lazy_type_alias)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Jun 19, 2023

This is a tracking issue for the feature lazy type aliases.
It's considered to be a “sophisticated bug fix” for #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.
  • 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.

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. :)

@GuillaumeGomez GuillaumeGomez added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. labels Jun 19, 2023
@GuillaumeGomez GuillaumeGomez changed the title Tracking Issue for type_alias_type feature flag Tracking Issue for lazy_type_alias feature flag Jun 21, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 21, 2023
…oli-obk

Add `lazy_type_alias` feature gate

Add the `type_alias_type` to be able to have the weak alias used without restrictions.

Part of rust-lang#112792.

cc `@compiler-errors`
r? `@oli-obk`
@rustbot rustbot added the F-lazy_type_alias `#![feature(lazy_type_alias)]` label Jul 29, 2023
@crlf0710 crlf0710 added the A-maybe-future-edition Something we may consider for a future edition. label Jul 30, 2023
@orhid

This comment was marked as resolved.

@fmease

This comment was marked as resolved.

@CAD97
Copy link
Contributor

CAD97 commented Dec 14, 2023

Recording:

Trailing where clauses on top level type aliases are currently syntax-stable (i.e. allowed under an inactive #[cfg]), and is only feature gated semantically (i.e. after macro expansion).

For other unstable features that were accidentally allowed as syntax-stable (e.g. macro items), we now have the forward-compatibility warning unstable_syntax_pre_expansion (#65860). We could potentially add this syntax into that machinery if we want to be conservative w.r.t. the unstable feature.

But on the other hand, trailing where is already allowed for associated types, so it being syntax stable for top level type aliases isn't particularly worrying or risky.

TL;DR: it being syntax stable deserves to be recorded, and is fine to remain such without any FCW (imo).

@fmease fmease self-assigned this Dec 28, 2023
@fmease fmease added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Dec 28, 2023
@fmease fmease changed the title Tracking Issue for lazy_type_alias feature flag Tracking issue for lazy type aliases Jan 23, 2024
@fmease

This comment was marked as resolved.

@CAD97

This comment was marked as resolved.

@fmease fmease added the B-unstable Feature: Implemented in the nightly compiler and unstable. label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-maybe-future-edition Something we may consider for a future edition. B-unstable Feature: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-lazy_type_alias `#![feature(lazy_type_alias)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
Status: Implementation
Development

No branches or pull requests

6 participants