-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
improper_ctypes_definitions
lint
#72700
improper_ctypes_definitions
lint
#72700
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
improper_ctypes_declarations
lintimproper_ctypes_definitions
lint
A try build that I could install with |
⌛ Trying commit 7cbdc2d58423511e6f336424955a17c891b13c03 with merge 672712eca084ef382c9505561aac6e15fbefe8ab... |
☀️ Try build successful - checks-azure |
I am unable to test this build in Servo as the
|
I don't have the time to actually review this at the moment, but after glancing over the implementation I remembered some unstated ideas underlying my past comments advocating for separate lints. The tl;dr is that I think the approach of adding more "modes" to the existing |
7cbdc2d
to
dbc8a3a
Compare
r? @varkor |
Will try to review soon. |
This comment has been minimized.
This comment has been minimized.
dbc8a3a
to
3d9e5ba
Compare
This comment has been minimized.
This comment has been minimized.
3d9e5ba
to
379486c
Compare
This comment has been minimized.
This comment has been minimized.
379486c
to
055377c
Compare
@bors retry |
⌛ Testing commit 4504648 with merge ae3f308cf38eb55957fed008aa952276ac949b3e... |
💥 Test timed out |
Rollup of 6 pull requests Successful merges: - rust-lang#72700 (`improper_ctypes_definitions` lint) - rust-lang#73516 (Allow dynamic linking for iOS/tvOS targets) - rust-lang#73616 (Liballoc minor hash import tweak) - rust-lang#73634 (Add UI test for issue 73592) - rust-lang#73688 (Document the self keyword) - rust-lang#73698 (Add procedure for prioritization notifications on Zulip) Failed merges: r? @ghost
rust-lang/rust#72700 caused the existing `allow(improper_ctypes)` guard to stop working, we now need `allow(improper_ctypes_definitions)` instead. We keep the old one to avoid any issues with older nightlies. Signed-off-by: Joe Richey <[email protected]>
rust-lang/rust#72700 caused the existing `allow(improper_ctypes)` guard to stop working, we now need `allow(improper_ctypes_definitions)` instead. We keep the old one to avoid any issues with older nightlies. Signed-off-by: Joe Richey <[email protected]>
rust-lang/rust#72700 caused the existing `allow(improper_ctypes)` guard to stop working, we now need `allow(improper_ctypes_definitions)` instead. We keep the old one to avoid any issues with older nightlies. Signed-off-by: Joe Richey <[email protected]>
Sorry for being a bit late to the punch on this, but this feels like it's still noisy in some cases where it probably shouldn't be. For example:
where in this case |
This was enabled in rust-lang/rust#72700 but it looks like it's still too noisy for it to be useful to us.
This was enabled in rust-lang/rust#72700 but it looks like it's still too noisy for it to be useful to us.
This was enabled in rust-lang/rust#72700 but it looks like it's still too noisy for it to be useful to us.
FWIW this is actually a bit extra onerous because if you write |
This was enabled in rust-lang/rust#72700 but it looks like it's still too noisy for it to be useful to us.
Yeah I'm now also getting these warnings all over the place for Rust types in Boxes, which should be FFI safe (in fact that's specifically documented to be FFI safe) |
I'll have a PR up to resolve this soon. |
…ns-boxes, r=davidtwco improper_ctypes_definitions: allow `Box` Addresses rust-lang#72700 (comment). This PR stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. cc @alexcrichton @CryZe
…ns-boxes, r=davidtwco improper_ctypes_definitions: allow `Box` Addresses rust-lang#72700 (comment). This PR stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. cc @alexcrichton @CryZe
…ns-boxes, r=davidtwco improper_ctypes_definitions: allow `Box` Addresses rust-lang#72700 (comment). This PR stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. cc @alexcrichton @CryZe
…ns-boxes, r=davidtwco improper_ctypes_definitions: allow `Box` Addresses rust-lang#72700 (comment). This PR stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. cc @alexcrichton @CryZe
Addresses #19834, #66220, and #66373.
This PR takes another attempt at #65134 (reverted in #66378). Instead of modifying the existing
improper_ctypes
lint to considerextern "C" fn
definitions in addition toextern "C" {}
declarations, this PR adds a new lint -improper_ctypes_definitions
- which only applies toextern "C" fn
definitions.In addition, the
improper_ctype_definitions
lint differs fromimproper_ctypes
by considering*T
and&T
(whereT: 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)