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

Prevent incorrect cast_lossless suggestion in const_fn #3700

Merged

Conversation

@phansch
Copy link
Member

@phansch phansch commented Jan 26, 2019

::from is not a const fn, so applying the suggestion of
cast_lossless would fail to compile. The fix is to skip the lint if
the cast is found inside a const fn.

Fixes #3656

`::from` is not a const fn, so applying the suggestion of
`cast_lossless` would fail to compile. The fix is to skip the lint if
the cast is found inside a const fn.
@phansch phansch force-pushed the phansch:would_you_like_some_help_with_this_const_fn branch from 7e5f04b to 8c416c3 Jan 26, 2019
@oli-obk
Copy link
Collaborator

@oli-obk oli-obk commented Jan 28, 2019

@bors r+

@bors
Copy link
Contributor

@bors bors commented Jan 28, 2019

📌 Commit 8c416c3 has been approved by oli-obk

@bors
Copy link
Contributor

@bors bors commented Jan 28, 2019

Testing commit 8c416c3 with merge 410d5ba...

bors added a commit that referenced this pull request Jan 28, 2019
…t_fn, r=oli-obk

Prevent incorrect cast_lossless suggestion in const_fn

`::from` is not a const fn, so applying the suggestion of
`cast_lossless` would fail to compile. The fix is to skip the lint if
the cast is found inside a const fn.

Fixes #3656
@bors
Copy link
Contributor

@bors bors commented Jan 28, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 410d5ba to master...

@bors bors merged commit 8c416c3 into rust-lang:master Jan 28, 2019
2 checks passed
2 checks passed
@travis-ci
Travis CI - Pull Request Build Passed
Details
@bors
homu Test successful
Details
@phansch phansch deleted the phansch:would_you_like_some_help_with_this_const_fn branch Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants