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
merged 1 commit into from Jan 28, 2019

Conversation

Projects
None yet
3 participants
@phansch
Copy link
Collaborator

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

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.

@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

This comment has been minimized.

Copy link
Collaborator

oli-obk commented Jan 28, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 28, 2019

📌 Commit 8c416c3 has been approved by oli-obk

@bors

This comment has been minimized.

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

Auto merge of #3700 - phansch:would_you_like_some_help_with_this_cons…
…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

This comment has been minimized.

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

1 check passed

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
You can’t perform that action at this time.