Age | Commit message (Collapse) | Author |
|
This fixes a panic uncovered by the proc_macro update, which validates idents
now. We were using it as a pretty crappy way to turn it into something that
could be turned into a TokenStream. But TokenStream implements FromStr now.
|
|
This should allow making it a HashSet.
|
|
This wins between 2 and 5 milliseconds more in the test-case above, so no reason
not to I guess.
|
|
This isn't such a massive win as I'd have hoped, but it is consistently faster,
so there's no reason not to.
> ./bindgen-old tests/stylo.hpp --no-rustfmt-bindings > /dev/null 2>&1
6.17s user 0.84s system 98% cpu 7.079 total
> ./target/release/bindgen tests/stylo.hpp --no-rustfmt-bindings > /dev/null 2>
5.92s user 0.87s system 98% cpu 6.866 total
Which isn't _that_ much but it's quite a bit.
|
|
The root cause of the issue was the missing:
```
self.saw_bindgen_union |= new.saw_bindgen_union;
```
But I also cleaned up a bit more and removed the unused saw_union.
Fixes #1457
|
|
I give up on the doc comments. This is a rebase of #1334 keeping the formatting
of the comments and using TokenStream::from_str instead because one can hope.
Fixes #1407.
|
|
This allows for explicit selection of which traits are derived for a
type, e.g. deriving custom traits on particular types that need it.
Example usage:
```C++
/// <div rustbindgen derive="Clone"></div>
/// <div rustbindgen derive="MyDerivableTrait"></div>
struct foo { ... };
```
generates into
```Rust
#[derive(Clone,MyDerivableTrait)]
struct foo { ... }
```
|
|
|
|
|
|
attribute(overloadable).
Fixes #1350
|
|
Fixes #1429.
|
|
|
|
|
|
Fixes #1412.
|
|
Since #1378 broke a bunch of OSX builds.
Most people don't care about them and they're in some OSX system headers which
means that this could break normal C and C++ stuff.
This introduces --generate-block / generate_block to generate these signatures,
and adds tests so that this is getting tested.
|
|
|
|
|
|
PartialOrd and Ord for enum
Hello all,
This PR tries to fix #1395.
Many thanks for any comment.
|
|
|
|
Also adds a test header I missed from the previous PR.
Fixes #1393
|
|
To work-around some cases of https://github.com/rust-lang/rust/issues/54341.
Other cases where u128 and u64 are mixed in fields might not behave correctly,
but the field offset assertions would catch them.
Fixes #1370
|
|
|
|
This is very mechanical and boring, but needed.
|
|
|
|
|
|
|
|
As --use-core is typically given when the wrapped library is to be used
in a no_std environment, format! and String can not be used.
This is a quick fix that will cause regressions in the quality of the
debug output to users that use core but are not no_std, but enables the
use of bindgen with implemented Debug traits to no_std users.
Closes: https://github.com/rust-lang-nursery/rust-bindgen/issues/1100
|
|
Contributes-To: https://github.com/rust-lang-nursery/rust-bindgen/issues/1100
|
|
|
|
rustc fail to compile variadic function with ms_abi:
error[E0045]: variadic function must have C or cdecl calling convention
As suggested in issue, this short term fix: not generate binding
and emit a warning.
Fixes #997
|
|
Map vector types to arrays and pass them by value
This PR maps vector types to arrays and passes them by value (that is, they are passed to C as `[T; N]`. This already allows defining them as a blacklisted opaque type, such that the user can provide its own definition from e.g. `std::arch`.
A subsequent PR should map vector types to unit structs with a private member:
```rust
#[repr(align(16))] pub struct __m128([f32; 4]);
```
to make their alignment at least be correct. This should allow transmuting `std::arch` types to these types properly.
Once that is done, we probably want to detect the canonical vector types (e.g. `__m128`) and pull in the type from `std`/`core`::arch instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
blob() does care about alignment, so we can get into an architecture where there
are integers where size != align.
This is a tentative fix for https://github.com/servo/servo/issues/21093, though
as mentioned there I couldn't find a repro on my machine.
|
|
Fixes #1345
|
|
Followup to #1342
|
|
Fixes #1340
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Only when modules are enabled of course.
|
|
|