Age | Commit message (Collapse) | Author |
|
|
|
|
|
This replaces various `unwrap` calls with `expect` calls that have better
diagnostic messages if/when they fail.
|
|
This commit defines a new set of assertion macros that are only checked in
testing/CI when the `testing_only_extra_assertions` feature is enabled. This
makes it so that *users* of bindgen that happen to be making a debug build don't
enable all these extra and expensive assertions.
Additionally, this removes the `testing_only_assert_no_dangling_items` feature,
and runs the assertions that were previously gated on that feature when the new
`testing_only_extra_assertions` feature is enabled.
|
|
This commit ensures that all of the cargo features we have that only exist for
CI/testing purposes, and aren't for external consumption, have a "testing_only_"
prefix.
|
|
Don't build documentation for the binary, just the lib
This enables one to locally do
$ cargo doc
and get library level documentation. Without the changes, cargo doesn't know whether to build docs for the binary or library, and so instead it gives an error and stops.
r? @emilio
|
|
This enables one to locally do
$ cargo doc
and get library level documentation. Without the changes, cargo doesn't know
whether to build docs for the binary or library, and so instead it gives an
error and stops.
|
|
Add a test explicitly for default type parameters
This is exercised in other tests, but in a round about fashion. It is nice to have a test that explicitly exercises default type parameters, without any cruft.
r? @emilio
|
|
This is exercised in other tests, but in a round about fashion. It is nice to
have a test that explicitly exercises default type parameters, without any
cruft.
|
|
Generalize template instantiation fallibility
Return `None` whenever we can't find a template definition, not only when the
template is a builtin.
Hitting this in other tests with libclang 4
r? @emilio or @upsuper
|
|
But only if the type is not a builtin type. If it is a builtin type, then it's
expected that we won't have a definition.
|
|
Return `None` whenever we can't find a template definition, not only when the
template is a builtin.
|
|
Handle when we can't instantiate templates because we can't find a template definition
https://github.com/servo/rust-bindgen/pull/594 + my review commetn about using opaque types
|
|
|
|
This should fix #584.
|
|
Fall back to opaque types rather than panicking on parse failure
Getting closer to figuring out some of the other template related issues in clang 4.0, but not quite ready to land them yet. Figure this should probably land in the meantime. This is just a better fallback in the face of the unknown for panics that we've had reports of in the wild, but which I haven't had time to creduce.
r? @emilio
|
|
|
|
Treat char as c_char
Per #603.
This still leaves `bindgen` having to make a call as to what to say when asked whether `Char` `is_signed()`. I've opted just to leave this as `true`, on the grounds that:
* I don't currently understand an example where it matters
* I suspect that if there are cases where it matters, then it shouldn't!
* Because by definition, use of unadorned `char` in the original header says that it doesn't care about signedness
* (signed is the common case, so that's a more sensible guess than unsigned)
|
|
|
|
|
|
ir: Handle char in a more cross-platform way when possible.
This should address #603, and supersede #609
|
|
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
|
|
Destructor codegen
Based on #542, and on top of #606, with a bunch more tests and fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This should resolve #571. As discussed with @fitzgen I have moved the builtin-filtering out of `ast_dump` itself; this logic now happens at the point of call in `src/lib.rs`
|
|
|
|
clang: Fix most of the clang 5.0 regressions in our tests.
|
|
|
|
Add a `Builder::header_contents` method to allow passing source code as a string to a Builder
Currently the Builder API requires input as header files on disk. This allows
passing C source directly to clang using the existing UnsavedFile struct.
I'm going to take a shot at implementing a webapp that lets users paste in C source and get the bindgen output. It would make life easier if I didn't have to write the source out to a temp file. This patch allows passing the source in as a `&str`.
I wasn't quite sure where to put the new test, but it seems to work in tests.rs.
|
|
string to a Builder
Currently the Builder API requires input as header files on disk. This allows
passing C source directly to clang using the existing UnsavedFile struct.
|
|
ir: Prefer the enum definition instead of the declaration when looking for variants.
Fixes #599
|
|
|
|
variants.
|
|
Make vtables non-zero-size to fix a rustc warning.
```
warning: found non-foreign-function-safe member in struct marked #[repr(C)]: found zero-size struct in foreign module, consider adding a member to this struct
```
Emilio said on IRC:
> the empty vtable means that we don't care of figuring out the proper vtable layout, so we create an empty struct
Sounds like all that matters is to have a pointer, we don’t look at the data behind it. Using `c_void` seems appropriate, then.
|
|
```
warning: found non-foreign-function-safe member in struct marked #[repr(C)]: found zero-size struct in foreign module, consider adding a member to this struct
```
|
|
https://github.com/servo/rust-bindgen/pull/597#issuecomment-288006557
|
|
options: Allow force-generating inline functions.
|
|
|
|
How would you suggest testing this?
|
|
Added tests and fixed missed function rename.
Fixed nits
Renamed visitor to callbacks.
Renamed visitor to callbacks.
Renamed visitor to callbacks.
Fixed text.
|
|
r=emilio
Resolve namespace clashes between methods and generated bitfield accessors
This commit makes bitfields' accessor codegen detect conflicting method names
and generate alternative, non-conflicting names instead.
Yes, I really hit this in SpiderMonkey...
r? @emilio
|