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

Many small deriving cleanups #98741

Merged
merged 12 commits into from
Jul 1, 2022
Merged

Commits on Jun 30, 2022

  1. Use split_{first,last} in cs_fold1.

    It makes the code a little nicer to read.
    nnethercote committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    72a1621 View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary fields from EnumNonMatchingCollapsed.

    The `&[ast::Variant]` field isn't used.
    
    The `Vec<Ident>` field is only used for its length, but that's always
    the same as the length of the `&[Ident]` and so isn't necessary.
    nnethercote committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    7a4fdcb View commit details
    Browse the repository at this point in the history
  3. Remove Substructure::method_ident.

    It's unused.
    nnethercote committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    d13fa0d View commit details
    Browse the repository at this point in the history
  4. Remove {Method,Trait}Def::is_unsafe.

    They are always `false`.
    nnethercote committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    1254fe9 View commit details
    Browse the repository at this point in the history
  5. Remove Substructure::self_args.

    It's unused.
    nnethercote committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    89f6917 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    57d5689 View commit details
    Browse the repository at this point in the history
  7. Remove some commented-out code.

    This was accidentally left behind in a previous commit.
    nnethercote committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    623ebbe View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2022

  1. expand_deriving_clone tweaks.

    Improve a comment, and panic on an impossible code path.
    nnethercote committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    78ec19f View commit details
    Browse the repository at this point in the history
  2. Simplify pointer handling.

    The existing derive code allows for various possibilities that aren't
    needed in practice, which complicates the code. There are only a few
    auto-derived traits and new ones are unlikely, so this commit simplifies
    things.
    
    - `PtrTy` has been eliminated. The `Raw` variant was never used, and the
      lifetime for the `Borrowed` variant was always `None`. That left just
      the mutability field, which has been inlined as necessary.
    - `MethodDef::explicit_self` was a confusing `Option<Option<PtrTy>>`.
      Indicating either `&self` or nothing. It's now a `bool`.
    - `borrowed_self` is renamed as `self_ref`.
    - `Ty::Ptr` is renamed to `Ty::Ref`.
    nnethercote committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    b942466 View commit details
    Browse the repository at this point in the history
  3. Remove lifetime support in deriving code.

    It's unused.
    nnethercote committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    18fef6b View commit details
    Browse the repository at this point in the history
  4. Rename Ty::Literal as Ty::Path.

    Because a `Literal` is a type of expression, and is simply the wrong
    name for this.
    nnethercote committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    00307a5 View commit details
    Browse the repository at this point in the history
  5. Change Ty::Tuple to Ty::Unit.

    Because that's all that is needed in practice.
    nnethercote committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    85e8d94 View commit details
    Browse the repository at this point in the history