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

Fix missing_const_for_fn false positive #4450

Merged
merged 2 commits into from
Aug 29, 2019
Merged

Conversation

phansch
Copy link
Member

@phansch phansch commented Aug 25, 2019

We don't want to lint if the type of the method implements drop.
(constant functions cannot evaluate destructors)

changelog: Fix missing_const_for_fn false positive

Fixes #4449

@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 25, 2019
@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 26, 2019
We don't want to lint if any of the input parameters implement drop.

(constant functions cannot evaluate destructors)
@phansch
Copy link
Member Author

phansch commented Aug 29, 2019

The lint now checks all arguments for types that implement Drop. Should be ready for another review.

@phansch phansch added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Aug 29, 2019
@phansch
Copy link
Member Author

phansch commented Aug 29, 2019

Apparently I forgot to commit the updated .stderr, will do that later today 🤦‍♂️

Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

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

r=me with stderr files.

@phansch
Copy link
Member Author

phansch commented Aug 29, 2019

@bors r=flip1995

@bors
Copy link
Contributor

bors commented Aug 29, 2019

📌 Commit 5e1fdf9 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Aug 29, 2019

⌛ Testing commit 5e1fdf9 with merge 28a8a6a...

bors added a commit that referenced this pull request Aug 29, 2019
Fix missing_const_for_fn false positive

We don't want to lint if the type of the method implements drop.
(constant functions cannot evaluate destructors)

changelog: Fix `missing_const_for_fn` false positive

Fixes #4449
@bors
Copy link
Contributor

bors commented Aug 29, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing 28a8a6a to master...

@bors bors merged commit 5e1fdf9 into rust-lang:master Aug 29, 2019
@phansch phansch deleted the fix_const_fn_fp branch August 29, 2019 17:54
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.

Wrong suggestion of const fn if type implements Drop
4 participants