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

Visit attributes in more places. #96745

Merged
merged 8 commits into from
Aug 15, 2022

Commits on Aug 12, 2022

  1. Check attributes on pattern fields.

    Attributes on pattern struct fields were not being checked for validity.
    This adds the fields as HIR nodes so that the `CheckAttrVisitor` can
    visit those nodes to check their attributes.
    ehuss committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    1b464c7 View commit details
    Browse the repository at this point in the history
  2. Check attributes on struct expression fields.

    Attributes on struct expression fields were not being checked for
    validity. This adds the fields as HIR nodes so that `CheckAttrVisitor`
    can visit those nodes to check their attributes.
    ehuss committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    b651c1c View commit details
    Browse the repository at this point in the history
  3. Honor lint level attributes in more places.

    This extends the LintLevelBuilder to handle lint level attributes on
    struct expression fields and pattern fields.
    
    This also updates the early lints to honor lint levels on generic
    parameters.
    ehuss committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    6c7cb2b View commit details
    Browse the repository at this point in the history
  4. Add visitors for PatField and ExprField.

    This helps simplify the code. It also fixes it to use the correct parent
    when lowering. One consequence is the `non_snake_case` lint needed
    to change the way it looked for parent nodes in a struct pattern.
    
    This also includes a small fix to use the correct `Target` for
    expression field attribute validation.
    ehuss committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    dcd5177 View commit details
    Browse the repository at this point in the history
  5. Make Node::ExprField a child of Node::Expr.

    This was incorrectly inserting the ExprField as a sibling of the struct
    expression.
    
    This required adjusting various parts which were looking at parent node
    of a field expression to find the struct.
    ehuss committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    7b36047 View commit details
    Browse the repository at this point in the history
  6. Add missing visit_pat_field in early lint visitor.

    This ensures that lint attributes on pattern fields can control
    early lints.
    ehuss committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    c655f17 View commit details
    Browse the repository at this point in the history
  7. Fix diagnostic that was looking for a PatKind::Struct

    Now that fields are first-class HIR nodes, they appear before the struct pat.
    ehuss committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    1c70b86 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    900a9d3 View commit details
    Browse the repository at this point in the history