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

libsyntax: Refactor deriving to reduce boilerplate required & derive Ord, TotalOrd and TotalEq #5640

Closed
wants to merge 7 commits into from

Commits on Apr 12, 2013

  1. libsyntax: abstract most of the deriving boilerplate into a simpler(r…

    …) interface.
    
    Pulls out many of the common patterns from the Eq and Clone deriving code (and
    invents a few of its own), so that deriving instances are very easy to write
    for a certain class of traits. (Basically, those which don't have parameters
    and where all methods only take arguments of type `&Self` and return either
    `Self` or types with no parameters.)
    huonw committed Apr 12, 2013
    Configuration menu
    Copy the full SHA
    3698ea7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    85b82c7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7906c55 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9949279 View commit details
    Browse the repository at this point in the history
  5. libsyntax: short-circuit on non-matching variants in deriving code.

    Allow a deriving instance using the generic code to short-circuit for
    any non-matching enum variants (grouping them all into a _ match),
    reducing the number of arms required. Use this to speed up the Eq &
    TotalEq implementations.
    huonw committed Apr 12, 2013
    4 Configuration menu
    Copy the full SHA
    bff3748 View commit details
    Browse the repository at this point in the history
  6. 4 Configuration menu
    Copy the full SHA
    ea9bdaa View commit details
    Browse the repository at this point in the history
  7. 5 Configuration menu
    Copy the full SHA
    5c376e5 View commit details
    Browse the repository at this point in the history