Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd --no-partialeq <regex> flag #996
Conversation
highfive
assigned
fitzgen
Sep 16, 2017
highfive
added
the
S-awaiting-review
label
Sep 16, 2017
fitzgen
reviewed
Sep 18, 2017
|
Yep! This looks like what I would expect it to. You're on the right path :) |
| @@ -144,6 +145,11 @@ impl<'ctx> MonotoneFramework for CannotDerivePartialEq<'ctx> { | |||
| }; | |||
| } | |||
|
|
|||
| let name = item.canonical_name(self.ctx); | |||
| if self.ctx.options().no_partialeq_types.matches(&name) { | |||
This comment has been minimized.
This comment has been minimized.
fitzgen
Sep 18, 2017
Member
Let's abstract this check into a BindgenContext::no_partialeq_by_name, similar to BindgenContext::is_opaque_by_name and BindgenContext::is_blacklisted_by_name.
This comment has been minimized.
This comment has been minimized.
|
|
highfive
added
the
S-needs-rebase
label
Sep 18, 2017
alexeyzab
force-pushed the
alexeyzab:add-no-partialeq-command
branch
from
7c8f70b
to
e838a12
Sep 19, 2017
This comment has been minimized.
This comment has been minimized.
|
r? @fitzgen |
This comment has been minimized.
This comment has been minimized.
|
It makes sense that opaque types still The explicitly whitelisted types always getting |
This comment has been minimized.
This comment has been minimized.
|
Hm yeah the test headers look how I'd expect them to, but the generated bindings don't. I'd try adding some debug
If you still can't figure out what's going on after that, I can try pulling these changes down myself and investigating. BTW, I'm not sure if you're aware that the "impl period" has just begun, but the folks hacking on |
This comment has been minimized.
This comment has been minimized.
|
|
highfive
added
the
S-needs-rebase
label
Sep 19, 2017
This comment has been minimized.
This comment has been minimized.
I've tried it just now, but the result is still the same. Makes me wonder if Thanks for the invite! :) |
alexeyzab
force-pushed the
alexeyzab:add-no-partialeq-command
branch
from
067c57b
to
2bcf255
Sep 19, 2017
alexeyzab
force-pushed the
alexeyzab:add-no-partialeq-command
branch
from
a6eadb4
to
ec8456b
Sep 19, 2017
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r+ Thanks @alexeyzab ! |
This comment has been minimized.
This comment has been minimized.
|
|
highfive
removed
S-awaiting-review
S-needs-rebase
labels
Sep 19, 2017
This comment has been minimized.
This comment has been minimized.
highfive
added
the
S-awaiting-merge
label
Sep 19, 2017
bors-servo
added a commit
that referenced
this pull request
Sep 19, 2017
This comment has been minimized.
This comment has been minimized.
|
|
alexeyzab commentedSep 16, 2017
•
edited
Related to #965.
Add a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set).
A Builder method to add strings to that RegexSet.
Plumbing in src/options.rs to convert --no-partialeq CLI flags into invocations of the builder method.
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).
Tests!
When the no-partialeq type is transitively referenced by a whitelisted item
When the no-partialeq type is explicitly whitelisted
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