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

Add lint to detect transmutes from float to integer #4889

Merged

Conversation

krishna-veerareddy
Copy link
Contributor

Add lint that detects transmutation from a float to an integer and suggests usage of {f32, f64}.to_bits() instead.

Fixes #3993

changelog: Add lint transmute_float_to_int

Add lint that detects transmutation from a float to an integer
and suggests usage of `{f32, f64}.to_bits()` instead.
`transmute.stderr` file line count exceeded due to the new test
cases so moving the new test cases into a separate file.
@llogiq
Copy link
Contributor

llogiq commented Dec 8, 2019

Thank you! @bors r+

@bors
Copy link
Collaborator

bors commented Dec 8, 2019

📌 Commit 23c03e4 has been approved by llogiq

@bors
Copy link
Collaborator

bors commented Dec 8, 2019

⌛ Testing commit 23c03e4 with merge b245fbd...

bors added a commit that referenced this pull request Dec 8, 2019
…smute, r=llogiq

Add lint to detect transmutes from float to integer

Add lint that detects transmutation from a float to an integer and suggests usage of `{f32, f64}.to_bits()` instead.

Fixes #3993

changelog: Add lint `transmute_float_to_int`
@bors
Copy link
Collaborator

bors commented Dec 8, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: llogiq
Pushing b245fbd to master...

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.

[lint request] unnecessary_float_transmute
3 participants