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

Unlock trailing where-clauses for lazy type aliases #114662

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

fmease
Copy link
Member

@fmease fmease commented Aug 9, 2023

Allows trailing where-clauses on lazy type aliases and forbids1 leading ones.
Completes #89122 (see section Top-level type aliases).

@rustbot label F-lazy_type_alias
r? @oli-obk

Footnotes

  1. This is absolutely fine since lazy type aliases are only meant to be stabilized as part of a new edition.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. F-lazy_type_alias `#![feature(lazy_type_alias)]` labels Aug 9, 2023
Comment on lines 1333 to 1338
error.span,
fluent::ast_passes_deprecated_where_clause_location,
BuiltinLintDiagnostics::DeprecatedWhereclauseLocation(
error.sugg.right,
error.sugg.snippet,
),
Copy link
Member Author

@fmease fmease Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit awkward. Sadly I couldn't find an obvious way to deduplicate the error diagnostic WhereClauseBeforeTypeAlias & the lint diagnostic for DEPRECATED_WHERE_CLAUSE_LOCATION, the code of the latter is spread across two crates (rustc_ast_passes & rustc_lint_defs).

@rust-log-analyzer

This comment has been minimized.

@fmease fmease force-pushed the lazy-ty-aliases-unlock-trailing-wcs branch from 76faf05 to fe22afa Compare August 9, 2023 17:04
@fmease fmease force-pushed the lazy-ty-aliases-unlock-trailing-wcs branch from fe22afa to 051eb7c Compare August 10, 2023 14:13
@oli-obk
Copy link
Contributor

oli-obk commented Aug 10, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Aug 10, 2023

📌 Commit 051eb7c has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 11, 2023
…mpiler-errors

Rollup of 7 pull requests

Successful merges:

 - rust-lang#114599 (Add impl trait declarations to SMIR)
 - rust-lang#114622 (rustc: Move `crate_types` and `stable_crate_id` from `Session` to `GlobalCtxt`)
 - rust-lang#114662 (Unlock trailing where-clauses for lazy type aliases)
 - rust-lang#114693 (Remove myself from the review rotation)
 - rust-lang#114694 (make the provisional cache slightly less broken)
 - rust-lang#114705 (Add spastorino to mailmap)
 - rust-lang#114712 (Fix a couple of bad comments)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 076c9d7 into rust-lang:master Aug 11, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 11, 2023
@fmease fmease deleted the lazy-ty-aliases-unlock-trailing-wcs branch August 11, 2023 07:26
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 27, 2023
…lebcartwright

Amend style guide section for formatting where clauses in type aliases

This PR has two parts:
1. Amend wording about breaking before or after the `=`, which is a style guide bugfix to align it with current rustfmt behavior.
2. Explain how to format trailing (rust-lang#89122) where clauses, which are preferred in both GATs (rust-lang#90076) and type aliases (rust-lang#114662).

r? `@joshtriplett`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-lazy_type_alias `#![feature(lazy_type_alias)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants