Skip to content

Rustup #6718

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

Merged
merged 9 commits into from
Feb 11, 2021
Merged

Rustup #6718

merged 9 commits into from
Feb 11, 2021

Conversation

flip1995
Copy link
Member

r? @ghost

changelog: none

Manishearth and others added 9 commits February 2, 2021 20:43
Refactor `PrimitiveTypeTable` for Clippy

I removed `PrimitiveTypeTable` and added `PrimTy::ALL` and `PrimTy::from_name` in its place. This allows Clippy to use `PrimTy::from_name` for the `builtin_type_shadow` lint, and a `const` list of primitive types is deleted from Clippy code (the goal). All changes should be a little faster, if anything.
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 "*".
@flip1995
Copy link
Member Author

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Feb 11, 2021

📌 Commit 4efc454 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Feb 11, 2021

⌛ Testing commit 4efc454 with merge 70c0f90...

@flip1995
Copy link
Member Author

Thanks!

That's what I call muscle memory 😄

@bors
Copy link
Contributor

bors commented Feb 11, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 70c0f90 to master...

@bors bors merged commit 70c0f90 into rust-lang:master Feb 11, 2021
@flip1995 flip1995 deleted the rustup branch February 11, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants