Skip to content

Allow manual swap in const fn #9871

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

Merged
merged 2 commits into from
Nov 18, 2022
Merged

Allow manual swap in const fn #9871

merged 2 commits into from
Nov 18, 2022

Conversation

koka831
Copy link
Contributor

@koka831 koka831 commented Nov 18, 2022

Fix #9864

changelog: Fix [manual_swap]: No longer lints in constant code

@rust-highfive
Copy link

r? @Manishearth

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 18, 2022
Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

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

LGTM, would you mind adding a note about this to the lint description?

Maybe something like: The lint will not be emitted in const blocks, as the suggestion would not be applicable.

@xFrednet
Copy link
Member

r? @xFrednet

Since `std::mem::swap` is not stable as a const fn, the suggestion
would not be applicable in that cases
@koka831
Copy link
Contributor Author

koka831 commented Nov 18, 2022

@xFrednet thanks, added that!

@xFrednet
Copy link
Member

Perfect, thank you very much!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 18, 2022

📌 Commit 3c86cad has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 18, 2022

⌛ Testing commit 3c86cad with merge e144c7d...

@bors
Copy link
Contributor

bors commented Nov 18, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: xFrednet
Pushing e144c7d to master...

@bors bors merged commit e144c7d into rust-lang:master Nov 18, 2022
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.

manual_swap in const context false positive
5 participants