-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Unlock trailing where-clauses for lazy type aliases #114662
Conversation
error.span, | ||
fluent::ast_passes_deprecated_where_clause_location, | ||
BuiltinLintDiagnostics::DeprecatedWhereclauseLocation( | ||
error.sugg.right, | ||
error.sugg.snippet, | ||
), |
There was a problem hiding this comment.
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
).
This comment has been minimized.
This comment has been minimized.
76faf05
to
fe22afa
Compare
fe22afa
to
051eb7c
Compare
@bors r+ |
…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
…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`
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
This is absolutely fine since lazy type aliases are only meant to be stabilized as part of a new edition. ↩