-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying certain types we shouldn't derive/impl PartialEq for #965
Comments
5 tasks
I'd like to try adding this one. @highfive: assign me |
Hey @alexeyzab! Thanks for your interest in working on this issue. It's now assigned to you! |
alexeyzab
added a commit
to alexeyzab/rust-bindgen
that referenced
this issue
Sep 16, 2017
Related to rust-lang#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). - [] 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
alexeyzab
added a commit
to alexeyzab/rust-bindgen
that referenced
this issue
Sep 18, 2017
alexeyzab
added a commit
to alexeyzab/rust-bindgen
that referenced
this issue
Sep 19, 2017
Related to rust-lang#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). - [] 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
alexeyzab
added a commit
to alexeyzab/rust-bindgen
that referenced
this issue
Sep 19, 2017
alexeyzab
added a commit
to alexeyzab/rust-bindgen
that referenced
this issue
Sep 19, 2017
Related to rust-lang#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). - [] 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
alexeyzab
added a commit
to alexeyzab/rust-bindgen
that referenced
this issue
Sep 19, 2017
bors-servo
pushed a commit
that referenced
this issue
Sep 19, 2017
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
--no-partialeq <regex>
andBuilder::no_partialeq(String)
to supply regexes for matching against types that we should not derive or implementPartialEq
for.Adding this feature involves:
Adding a new
RegexSet
member tobindgen::Builder
(similar to thewhitelisted_types
set).A
Builder
method to add strings to thatRegexSet
.Plumbing in
src/options.rs
to convert--no-partialeq <regex>
CLI flags into invocations of the builder method.Making the
MonotoneFramework::constrain
function insrc/ir/analysis/derive_partialeq.rs
check if the given item is explicitly marked not to bePartialeq
, and if so, inserting it into theself.cannot_derive_partialeq
set viareturn 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
The text was updated successfully, but these errors were encountered: