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

Lint enum-to-int casts with cast_possible_truncation #8381

Merged
merged 3 commits into from
Feb 18, 2022

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Jan 31, 2022

fixes: #542

This will not lint casting a specific variant to an integer. That really should be a new lint as it's definitely a truncation (other than isize/usize values).

changelog: Lint enum-to-int casts with cast_possible_truncation
changelog: New lint cast_enum_truncation

@rust-highfive
Copy link

r? @Manishearth

(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 Jan 31, 2022
@Jarcho Jarcho force-pushed the cast_possible_truncation_542 branch 2 times, most recently from d275208 to ece4d65 Compare February 1, 2022 04:46
@bors
Copy link
Collaborator

bors commented Feb 18, 2022

☔ The latest upstream changes (presumably #8419) made this pull request unmergeable. Please resolve the merge conflicts.

@Jarcho Jarcho force-pushed the cast_possible_truncation_542 branch 3 times, most recently from 99d7050 to 5ed4827 Compare February 18, 2022 14:36
@Jarcho Jarcho force-pushed the cast_possible_truncation_542 branch from 5ed4827 to 88ecdd0 Compare February 18, 2022 14:47
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 18, 2022

📌 Commit 88ecdd0 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Feb 18, 2022

⌛ Testing commit 88ecdd0 with merge 73367f8...

@bors
Copy link
Collaborator

bors commented Feb 18, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 73367f8 to master...

@bors bors merged commit 73367f8 into rust-lang:master Feb 18, 2022
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.

warn on casting enum to numeric value
4 participants