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

pin Connection #249

Merged
merged 1 commit into from
Nov 12, 2019
Merged

pin Connection #249

merged 1 commit into from
Nov 12, 2019

Conversation

ghedo
Copy link
Member

@ghedo ghedo commented Nov 7, 2019

Due to the fact that we store a pointer to the Connection object inside
its own Handshake context, Connection objects cannot be moved (which is
why we return a boxed object from its constructor). Using Pin on it
makes the compiler enforce this.

Fixes #45.


Note this requires Rust 1.39.

@ghedo ghedo requested a review from a team as a code owner November 7, 2019 15:03
@LPardue
Copy link
Contributor

LPardue commented Nov 7, 2019

Nightly builds are failing due to errors like

error: `extern` fn uses type `Config`, which is not FFI-safe

   --> src/ffi.rs:81:50

    |

81  | pub extern fn quiche_config_new(version: u32) -> *mut Config {

    |                                                  ^^^^^^^^^^^ not FFI-safe

    |

    = note: `-D improper-ctypes` implied by `-D warnings`

    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct

    = note: this struct has unspecified layout

note: type defined here

   --> src/lib.rs:372:1

@ghedo
Copy link
Member Author

ghedo commented Nov 7, 2019

Looks like it's just the newer rust nightly, as master also fails :/

@ghedo
Copy link
Member Author

ghedo commented Nov 7, 2019

#251 should "fix" it.

junhochoi
junhochoi previously approved these changes Nov 7, 2019
Due to the fact that we store a pointer to the Connection object inside
its own Handshake context, Connection objects cannot be moved (which is
why we return a boxed object from its constructor). Using Pin on it
makes the compiler enforce this.

Fixes #45.
@ghedo
Copy link
Member Author

ghedo commented Nov 12, 2019

Added some more context to the commit message.

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

Successfully merging this pull request may close these issues.

Why is the Connection boxed by default?
3 participants