Skip to content

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Oct 15, 2025

ast::TyAliasWhereClauses is a tentative to avoid allocating two vectors for where clauses in type aliases.
It is incompatible with cfg attributes on where clauses.

This PR uses a regular WhereClause for the "second" clause.

Fixes #138010
cc #138037

@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. labels Oct 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2025

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

error[E0027]: pattern does not mention field `after_where_clause`
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:561:25
    |
561 |               TyAlias(box ast::TyAlias {
    |  _________________________^
562 | |                 defaultness: ld,
563 | |                 ident: li,
564 | |                 generics: lg,
...   |
---
help: if you don't care about this missing field, you can explicitly ignore it
    |
567 -                 ty: lt,
568 -             }),
567 +                 ty: lt, after_where_clause: _ }),
    |
help: or always ignore missing fields here
    |
567 -                 ty: lt,
568 -             }),
---

error[E0027]: pattern does not mention field `after_where_clause`
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:569:25
    |
569 |               TyAlias(box ast::TyAlias {
    |  _________________________^
570 | |                 defaultness: rd,
571 | |                 ident: ri,
572 | |                 generics: rg,
...   |
---
help: include the missing field in the pattern
    |
575 -                 ty: rt,
576 -             }),
575 +                 ty: rt, after_where_clause }),
    |
help: if you don't care about this missing field, you can explicitly ignore it
    |
575 -                 ty: rt,
576 -             }),
575 +                 ty: rt, after_where_clause: _ }),
    |
help: or always ignore missing fields here
    |
575 -                 ty: rt,
576 -             }),
575 +                 ty: rt, .. }),
    |

error[E0026]: struct `rustc_ast::TyAlias` does not have a field named `where_clauses`
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:648:17
    |
---
[RUSTC-TIMING] rustc_tools_util test:false 0.146
error[E0027]: pattern does not mention field `after_where_clause`
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:644:22
    |
644 |               Type(box TyAlias {
    |  ______________________^
645 | |                 defaultness: ld,
646 | |                 ident: li,
647 | |                 generics: lg,
...   |
---
help: if you don't care about this missing field, you can explicitly ignore it
    |
650 -                 ty: lt,
651 -             }),
650 +                 ty: lt, after_where_clause: _ }),
    |
help: or always ignore missing fields here
    |
650 -                 ty: lt,
651 -             }),
---

error[E0027]: pattern does not mention field `after_where_clause`
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:652:22
    |
652 |               Type(box TyAlias {
    |  ______________________^
653 | |                 defaultness: rd,
654 | |                 ident: ri,
655 | |                 generics: rg,
...   |
---
help: include the missing field in the pattern
    |
658 -                 ty: rt,
659 -             }),
658 +                 ty: rt, after_where_clause }),
    |
help: if you don't care about this missing field, you can explicitly ignore it
    |
658 -                 ty: rt,
659 -             }),
658 +                 ty: rt, after_where_clause: _ }),
    |
help: or always ignore missing fields here
    |
658 -                 ty: rt,
659 -             }),
658 +                 ty: rt, .. }),
    |

    Checking utf8parse v0.2.2
[RUSTC-TIMING] build_script_build test:false 0.157
    Checking indenter v0.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: mid > len on leading assoc ty / lazy type alias where clause with attributes

4 participants