Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jan 31, 2019

This checks if the value is a non-negative constant before linting about
losing the sign.

Because the constant function doesn't handle const functions, we check if
the value is from a call to a max_value function directly. A utility method
called get_def_path was added to make checking for the function paths
easier.

Fixes #2728

This checks if the value is a non-negative constant before linting about
losing the sign.

Because the `constant` function doesn't handle const functions, we check if
the value is from a call to a `max_value` function directly. A utility method
called `get_def_path` was added to make checking for the function paths
easier.

Fixes #2728
@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 31, 2019
@ghost
Copy link
Author

ghost commented Feb 1, 2019

I made the suggested changes.

Copy link
Contributor

@phansch phansch left a comment

Choose a reason for hiding this comment

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

Just a nit, otherwise LGTM

@phansch
Copy link
Contributor

phansch commented Feb 4, 2019

@bors r+ thanks!

@bors
Copy link
Contributor

bors commented Feb 4, 2019

📌 Commit f3ee53d has been approved by phansch

@bors
Copy link
Contributor

bors commented Feb 4, 2019

⌛ Testing commit f3ee53d with merge 4259377...

bors added a commit that referenced this pull request Feb 4, 2019
Fix `cast_sign_loss` false positive

This checks if the value is a non-negative constant before linting about
losing the sign.

Because the `constant` function doesn't handle const functions, we check if
the value is from a call to a `max_value` function directly. A utility method
called `get_def_path` was added to make checking for the function paths
easier.

Fixes #2728
@bors
Copy link
Contributor

bors commented Feb 4, 2019

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

@bors bors merged commit f3ee53d into rust-lang:master Feb 4, 2019
@ghost ghost deleted the fix-2728 branch May 11, 2019 08:07
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.

3 participants