Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
The definition of a template is always a type, so it should be a TypeId rather
than an ItemId. Template arguments, on the other hand are not guaranteed to be
types. They can be constant values, for example.
|
|
This commit makes certain `TypeKind`s that can only reference other types use
`TypeId` instead of `ItemId`.
|
|
|
|
None of the callers were passing template parameters.
|
|
|
|
This commit also makes `BindgenContext::resolve_type` take a `TypeId`, and adds
unchecked conversions everywhere that we call it. Next, I'm going to go through
the code base, replacing these unchecked conversions with checked ones, and
tightening up types as I go.
|
|
When choosing a parent ID for a type that we are parsing, prefer known semantic
parents over the provided parent ID. It seems like we shouldn't even be passing
explicit parent IDs around (they're often buggy), and instead should expand the
`known_semantic_parent` infrastructure, but I'll leave that to some future work.
Fixes #1048
|
|
Enable --rustfmt-bindings by default
This patch flips --rustfmt-bindings to --no-rustfmt-bindings and enables
formatting by default. If rustfmt is not accessible, a warning is
printed and the bindings are printed unformatted.
Addresses #977.
|
|
codegen: Avoid generating wrong type for enums with unknown representation
Fixes #1025
|
|
lib: Print warnings to stderr instead of stdout.
Seems like the right thing to do, and allows me to test stuff piping to rustc instead of saving to a file.
|
|
Make objc-related expectations compile
Fixes #1004.
After looking at how `msg_send!` is supposed to be used, I realized that
we were erroneously passing type signatures to it.
The expectations compile now, but some of them are not formatted properly.
My guess is that `rustfmt` does not know how to format the following:
```
msg_send!(obj, arg1:1 arg2:2 arg3:3)
```
Notice the lack of separatros between the `arg`s.
Any advice on how to proceed here is appreciated.
r? @fitzgen
|
|
|
|
|
|
Some little deriving cleanups
See each commit for details.
r? @emilio
|
|
WIP, fixes #1004.
After looking at how `msg_send!` is supposed to be used, I realized that
we were erroneously passing type signatures to it.
The expectations compile now, but some of them are not formatted properly.
My guess is that `rustfmt` does not know how to format the following:
```
msg_send!(obj, arg1:1 arg2:2 arg3:3)
```
Notice the lack of separatros between `arg`s.
|
|
Clean.
Add timer.
Clean codegen
|
|
This patch flips --rustfmt-bindings to --no-rustfmt-bindings and enables
formatting by default. If rustfmt is not accessible, a warning is
printed and the bindings are printed unformatted.
|
|
Impl_debug fixes
r? @fitzgen
|
|
|
|
|
|
|
|
Translate _ as __
This change treats _ as a reserved identifier to resolve the bug reported in #631.
I have one concern - if the header has both an `_` and `__` identifier in the global namespace, this will cause a conflict. However, it seems like we already don't handle that case for `keyword_` (e.g. `abstract_`, `alignof_`, etc.) so it doesn't seem like we need a solution specifically for `__` in this change.
Fixes #631.
|
|
|
|
The whole "should be a no-op" thing isn't really true for all of the traits,
especially in the face of black listing. Also further expounded on the
differences between the trivial versions and normal versions.
|
|
Again, this logic was getting copied all over the place, and it is nice to have
a single canonical definition.
|
|
We were copying it around and it will be easier if it is defined in one place.
|
|
Changing "partialeq" and "partialord" into "`PartialEq`" and "`PartialOrd`"
where it makes sense.
|
|
|
|
|
|
Add --no-partialeq <regex> flag
Related to #965.
- [x] Add a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set).
- [x] A Builder method to add strings to that RegexSet.
- [x] Plumbing in src/options.rs to convert --no-partialeq <regex> CLI flags into invocations of the builder method.
- [x] Make the MonotoneFramework::constrain function in src/ir/analysis/derive_partialeq.rs check if the given item is explicitly marked not to be Partialeq, and if so, insert it into the self.cannot_derive_partialeq set via return self.insert(id).
- [x] Tests!
- [x] When the no-partialeq type is transitively referenced by a whitelisted item
- [x] When the no-partialeq type is explicitly whitelisted
- [x] When the no-partialeq type is marked opaque
This is my first pass at implementing this functionality, I haven't implemented the tests yet. I wanted to make sure I am on the right track, particularly when it comes to updating `MonotoneFramework::constrain`.
r? @fitzgen
|
|
- [x] Add a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set).
- [x] A Builder method to add strings to that RegexSet.
- [x] Plumbing in src/options.rs to convert --no-partialeq <regex> CLI flags into invocations of the builder method.
- [x] Make the MonotoneFramework::constrain function in src/ir/analysis/derive_partialeq.rs check if the given item is explicitly marked not to be Partialeq, and if so, insert it into the self.cannot_derive_partialeq set via return self.insert(id).
- [x] Tests!
- [x] When the no-partialeq type is transitively referenced by a whitelisted item
- [x] When the no-partialeq type is explicitly whitelisted
- [x] When the no-partialeq type is marked opaque
Fixes #965
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes #987
Also, we were making a call to the now deprecated `Builder::hide_type`,
changed that over to call `Builder::blacklist_type.
|
|
Add a `Builder::blacklist_type`
This deprecates `Builder::hide_type`.
Related to #984.
- [x] Add Builder::blacklist_type, that does the same thing as hide_type
- [x] Mark Builder::hide_type as #[deprecated = "Use blacklist_type instead"]
- [x] Make hide_type delegate to blacklist_type
- [x] Rename the BindgenOptions::hidden_types member to BindgenOptions::blacklisted_types
- [x] Rename ir::context::BindgenContext::hidden_by_name to blacklisted_by_name
- [x] Rename ir::item::Item::is_hidden to is_blacklisted
r? @fitzgen
|
|
Depreciate whitelisted function.
Closes #985
I also noticed a reference to `whitelisted_function` within the book, should this be updated as well?
https://github.com/rust-lang-nursery/rust-bindgen/blob/a371de097f5e37eb01754525fb1e2029ca88b0be/book/src/whitelisting.md
I've started to learn rust recently, so please let me know if there is anything I missed.
|
|
This deprecates `Builder::hide_type`.
Related to #984.
- [x] Add Builder::blacklist_type, that does the same thing as hide_type
- [x] Mark Builder::hide_type as #[deprecated = "Use blacklist_type instead"]
- [x] Make hide_type delegate to blacklist_type
- [x] Rename the BindgenOptions::hidden_types member to BindgenOptions::blacklisted_types
- [x] Rename ir::context::BindgenContext::hidden_by_name to blacklisted_by_name
- [x] Rename ir::item::Item::is_hidden to is_blacklisted
|
|
Closes #985
|