-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add repr(transparent) to hyper_context #3498
base: master
Are you sure you want to change the base?
Conversation
Looks like cbindgen changes the header generation from |
293df63
to
e64d8da
Compare
No idea! |
|
e64d8da
to
4efaa1a
Compare
Actually I'm not sure of |
3d73180
to
bd15e65
Compare
bd15e65
to
70fe4f6
Compare
Someone checked the ANSI C standard for me, repr(C) is fine |
@seanmonstar You should pick which one of transparent/packed/C you want here, all three are fine but I don't know enough about cbindgen's behavior. Ideally this would be configurable. |
We want two things:
cbindgen does not provide to force a type with a guaranteed layout to be opaque. We have a few options here:
1 is the most pragmatic, 2 should probably be done anyways (adding Context to std types) and 3 is probably the best long-term approach. If we want to go with 1, I can open a PR using my commit. |
hyper/src/ffi/task.rs
Line 504 in 1d4ff35
This comment is incorrect,
repr(Rust)
provides no such guarantees.(Also we probably should make most of these FFI types
repr(C)
))