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

Test FFI safety #2

Closed
dtolnay opened this issue Dec 11, 2020 · 2 comments
Closed

Test FFI safety #2

dtolnay opened this issue Dec 11, 2020 · 2 comments

Comments

@dtolnay
Copy link

dtolnay commented Dec 11, 2020

Given the name of the crate I would expect to have something to verify that the generated data structure is considered FFI-safe by rustc. I've seen rustc periodically introduce regressions in what is considered to be FFI-safe.

Something like:

#[deny(improper_ctypes, warnings)]
extern "C" {
    pub fn f(_: *const leveldb_t);
}
@nvzqz
Copy link
Contributor

nvzqz commented Dec 16, 2020

I tried making a macro for this (nvzqz/static-assertions#31), but #[deny] and #[forbid] do not pass through macros (rust-lang/rust#67720).

@skade
Copy link
Owner

skade commented Dec 16, 2020

Implemented in: Thanks for the suggestion!

533bfa6#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants