Skip to content

improper_ctypes_definitions lint#72700

Merged
bors merged 3 commits intorust-lang:masterfrom
davidtwco:issue-66220-improper-ctypes-declarations
Jun 25, 2020
Merged

improper_ctypes_definitions lint#72700
bors merged 3 commits intorust-lang:masterfrom
davidtwco:issue-66220-improper-ctypes-declarations

Conversation

@davidtwco
Copy link
Member

@davidtwco davidtwco commented May 28, 2020

Addresses #19834, #66220, and #66373.

This PR takes another attempt at #65134 (reverted in #66378). Instead of modifying the existing improper_ctypes lint to consider extern "C" fn definitions in addition to extern "C" {} declarations, this PR adds a new lint - improper_ctypes_definitions - which only applies to extern "C" fn definitions.

In addition, the improper_ctype_definitions lint differs from improper_ctypes by considering *T and &T (where T: Sized) FFI-safe (addressing #66220).

There wasn't a clear consensus in #66220 (where the issues with #65134 were primarily discussed) on the approach to take, but there has been some discussion in Zulip. I fully expect that we'll want to iterate on this before landing.

cc @varkor + @shepmaster (from #19834) @hanna-kruppe (active in discussing #66220), @SimonSapin (#65134 caused problems for Servo, want to make sure that this PR doesn't)

Loading
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.