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

Rename HIR UnOp variants #81913

Merged
merged 1 commit into from
Feb 10, 2021
Merged

Rename HIR UnOp variants #81913

merged 1 commit into from
Feb 10, 2021

Commits on Feb 9, 2021

  1. Rename HIR UnOp variants

    This renames the variants in HIR UnOp from
    
        enum UnOp {
            UnDeref,
            UnNot,
            UnNeg,
        }
    
    to
    
        enum UnOp {
            Deref,
            Not,
            Neg,
        }
    
    Motivations:
    
    - This is more consistent with the rest of the code base where most enum
      variants don't have a prefix.
    
    - These variants are never used without the `UnOp` prefix so the extra
      `Un` prefix doesn't help with readability. E.g. we don't have any
      `UnDeref`s in the code, we only have `UnOp::UnDeref`.
    
    - MIR `UnOp` type variants don't have a prefix so this is more
      consistent with MIR types.
    
    - "un" prefix reads like "inverse" or "reverse", so as a beginner in
      rustc code base when I see "UnDeref" what comes to my mind is
      something like "&*" instead of just "*".
    osa1 committed Feb 9, 2021
    Configuration menu
    Copy the full SHA
    c4e3558 View commit details
    Browse the repository at this point in the history