bors-servo 3eb8f70ca0 Auto merge of #689 - fitzgen:Kowasaki-master, r=fitzgen
Emit `PhantomData<UnsafeCell<T>>` members for all generic parameters

This makes generated generic structs lifetime invariant, since we cannot know
the C++ type's true variance.

Fixes #506

Rebased + squashed version of #635; cc @Kowasaki

To resolve the conflicts and rebase and squash, I did essentially these commands:

```
$ git fetch servo
$ git checkout -b Kowasaki-master servo/master
$ git merge --squash --edit Kowasaki/master
$ cargo test
$ cd tests/expectations
$ cargo test
$ cd -
$ git commit --author="Kowasaki"
$ git push fitzgen Kowasaki-master
```

Hopefully that is useful for you in the future :) Thanks for fixing this issue!
2017-05-05 13:21:22 -05:00
2017-05-01 13:04:42 -07:00
2017-04-26 18:05:24 -04:00
2017-04-26 18:05:24 -04:00
2017-04-26 18:05:24 -04:00
2017-05-03 22:14:03 +02:00
2017-05-03 22:14:03 +02:00
2013-08-05 10:43:15 +08:00
2017-04-26 18:05:24 -04:00

bindgen

bindgen automatically generates Rust FFI bindings to C and C++ libraries.

For example, given the C header cool.h:

typedef struct CoolStruct {
    int x;
    int y;
} CoolStruct;

void cool_function(int i, char c, CoolStruct* cs);

bindgen produces Rust FFI code allowing you to call into the cool library's functions and use its types:

/* automatically generated by rust-bindgen */

#[repr(C)]
pub struct CoolStruct {
    pub x: ::std::os::raw::c_int,
    pub y: ::std::os::raw::c_int,
}

extern "C" {
    pub fn cool_function(i: ::std::os::raw::c_int,
                         c: ::std::os::raw::c_char,
                         cs: *mut CoolStruct);
}

Users Guide

📚 Read the bindgen users guide here! 📚

API Reference

API reference documentation is on docs.rs

Contributing

See CONTRIBUTING.md for hacking on bindgen!

Description
No description provided
Readme BSD-3-Clause 14 MiB
Languages
Rust 97.6%
Python 1.6%
Shell 0.6%
Batchfile 0.1%
C 0.1%