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

clippy_lints: Do not warn against Box parameter in C FFI #6133

Merged
merged 6 commits into from
Oct 8, 2020
Merged

clippy_lints: Do not warn against Box parameter in C FFI #6133

merged 6 commits into from
Oct 8, 2020

Conversation

JPTIZ
Copy link
Contributor

@JPTIZ JPTIZ commented Oct 8, 2020

changelog: [boxed_local]: don't lint in extern fn arguments

Fixes #5542.

When using C FFI, to handle pointers in parameters it is needed to
declare them as Box in its Rust-side signature. However, the current
linter warns against the usage of Box stating that "local variable
doesn't need to be boxed here".

This commit fixes it by ignoring functions whose Abi is C.

Fixes #5542.

When using C FFI, to handle pointers in parameters it is needed to
declare them as `Box` in its Rust-side signature. However, the current
linter warns against the usage of Box stating that "local variable
doesn't need to be boxed here".

This commit fixes it by ignoring functions whose Abi is Cdecl.
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ebroto (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 8, 2020
@JPTIZ JPTIZ marked this pull request as ready for review October 8, 2020 02:01
Copy link
Member

@ebroto ebroto left a comment

Choose a reason for hiding this comment

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

Left some thoughts

clippy_lints/src/escape.rs Outdated Show resolved Hide resolved
tests/ui/escape_analysis.rs Outdated Show resolved Hide resolved
tests/ui/escape_analysis.rs Outdated Show resolved Hide resolved
tests/ui/escape_analysis.rs Outdated Show resolved Hide resolved
@ebroto ebroto 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 Oct 8, 2020
@ebroto
Copy link
Member

ebroto commented Oct 8, 2020

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Oct 8, 2020

📌 Commit b709b87 has been approved by ebroto

@bors
Copy link
Contributor

bors commented Oct 8, 2020

⌛ Testing commit b709b87 with merge e651a04...

@bors
Copy link
Contributor

bors commented Oct 8, 2020

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

@bors bors merged commit e651a04 into rust-lang:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

boxed_local: False positive for using Box in C FFI
4 participants