-
Notifications
You must be signed in to change notification settings - Fork 745
Allow specifying certain types we shouldn't derive/impl Hash for #964
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
Comments
I'll give this a shot. @highfive: assign me |
Hey @treiff! Thanks for your interest in working on this issue. It's now assigned to you! |
@treiff making any progress here? Anything that I can help with? |
Hey @fitzgen, sorry for the delay. I had made a little progress, however I've got a bunch going on with work and don't think I'm actually going to have the time to give this the attention it needs. Probably best you un-assign me. Thanks for the follow up reminder. |
No problem! |
@highfive: assign me |
Hey @seemyvest! Thanks for your interest in working on this issue. It's now assigned to you! |
Add --no-hash <regex> flag Issue #964 - [x] Adding 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-hash <regex> CLI flags into invocations of the builder method. - [x] Making the MonotoneFramework::constrain function in src/ir/analysis/derive_hash.rs check if the given item is explicitly marked not to be Hash, and if so, inserting it into the self.cannot_derive_hash set via return self.insert(id). - [x] Tests! - [x] When the no-hash type is transitively referenced by a whitelisted item - [x] When the no-hash type is explicitly whitelisted - [x] When the no-hash type is marked opaque r? @fitzgen
Fixed by #1105 |
Add
--no-hash <regex>
andBuilder::no_hash(String)
to supply regexes for matching against types that we should not derive or implementHash
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-hash <regex>
CLI flags into invocations of the builder method.Making the
MonotoneFramework::constrain
function insrc/ir/analysis/derive_hash.rs
check if the given item is explicitly marked not to beHash
, and if so, inserting it into theself.cannot_derive_hash
set viareturn self.insert(id)
.Tests!
When the no-hash type is transitively referenced by a whitelisted item
When the no-hash type is explicitly whitelisted
When the no-hash type is marked opaque
The text was updated successfully, but these errors were encountered: