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

Improve some deriving code and add a test #98376

Merged
merged 5 commits into from
Jun 29, 2022

Commits on Jun 26, 2022

  1. Configuration menu
    Copy the full SHA
    ea74997 View commit details
    Browse the repository at this point in the history
  2. Improve derived discriminant testing.

    Currently the generated code for methods like `eq`, `ne`, and `partial_cmp`
    includes stuff like this:
    ```
    let __self_vi = ::core::intrinsics::discriminant_value(&*self);
    let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
    if true && __self_vi == __arg_1_vi {
        ...
    }
    ```
    This commit removes the unnecessary `true &&`, and makes the generating
    code a little easier to read in the process. It also fixes some errors
    in comments.
    nnethercote committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    00207ea View commit details
    Browse the repository at this point in the history
  3. Merge build_enum_match_tuple into expand_enum_method_body.

    Because the latter just calls the former.
    
    The commit also updates some details in a comment.
    nnethercote committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    e739668 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b7855fa View commit details
    Browse the repository at this point in the history
  5. Convert process_variant functions into closures.

    It makes things a bit nicer.
    nnethercote committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    02d2cdf View commit details
    Browse the repository at this point in the history