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 would_you_like_some_help_with_this_const_fn branch from 7e5f04b to 8c416c3 Compare January 26, 2019 09:57
@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 26, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Jan 28, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Jan 28, 2019

📌 Commit 8c416c3 has been approved by oli-obk

@bors
Copy link
Contributor

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 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
@phansch phansch deleted the would_you_like_some_help_with_this_const_fn branch January 28, 2019 15:09
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.

cast_lossless is triggered on const fn
3 participants