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

Refactor casts lint #6873

Merged
merged 15 commits into from
Mar 9, 2021
Merged

Refactor casts lint #6873

merged 15 commits into from
Mar 9, 2021

Conversation

Y-Nak
Copy link
Contributor

@Y-Nak Y-Nak commented Mar 9, 2021

Ref: #6724

Changes:

  1. Separate the casts group from the types group.
  2. Reorganize the lints of the casts group into their own modules.

Notes:

  1. I didn't fix Use span_lint_and_sugg instead of span_lint in unnecessary_cast #6874 in order to maintain this PR as small as possible.

changelog: none

@rust-highfive
Copy link

r? @llogiq

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 9, 2021
@Y-Nak Y-Nak force-pushed the refactor-casts-lint branch from 1645295 to 9e631da Compare March 9, 2021 11:19
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +12 to +15
match cast_to.kind() {
ty::Uint(_) | ty::Int(..) => { /* continue on */ },
_ => return,
}
Copy link
Member

@flip1995 flip1995 Mar 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to go over the code and do some clean up. As an example: This would be nicer to do with

    if !matches!(cast_to.kind(), ty::Uint(_) | ty::Int(..)) {
        return;
    }

But this shouldn't be done in this PR.

@flip1995
Copy link
Member

flip1995 commented Mar 9, 2021

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Mar 9, 2021

📌 Commit 9e631da has been approved by flip1995

@bors
Copy link
Contributor

bors commented Mar 9, 2021

⌛ Testing commit 9e631da with merge 3ed0bcc...

@bors
Copy link
Contributor

bors commented Mar 9, 2021

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

@bors bors merged commit 3ed0bcc into rust-lang:master Mar 9, 2021
@Y-Nak Y-Nak deleted the refactor-casts-lint branch March 12, 2021 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants