-
Notifications
You must be signed in to change notification settings - Fork 744
Allow specifying certain types we shouldn't derive/impl Debug for #961
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
cc @jdm |
5 tasks
Hey! I'd like to give this one a shot. |
@njayinthehouse |
Hello, there seems no activity on this issue, I would like to give a try. |
Hey @ivanovaleksey! Thanks for your interest in working on this issue. It's now assigned to you! |
@ivanovaleksey hi! dont hestiate to ask questions, i will glad to answer! |
ivanovaleksey
added a commit
to ivanovaleksey/rust-bindgen
that referenced
this issue
Dec 11, 2017
11 tasks
Already implemented |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
--no-debug <regex>
andBuilder::no_debug(String)
to supply regexes for matching against types that we should not derive or implementDebug
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-debug <regex>
CLI flags into invocations of the builder method.Making the
MonotoneFramework::constrain
function insrc/ir/analysis/derive_debug.rs
check if the given item is explicitly marked not to beDebug
, and if so, inserting it into theself.cannot_derive_debug
set viareturn self.insert(id)
.Skipping any item explicitly marked not to be
Debug
insrc/codegen/derive_debug.rs
so that we don't generate animpl Debug for ...
for these types when--impl-debug
is passed.Tests!
When
--impl-debug
is also suppliedWhen
--impl-debug
is not also suppliedWhen the no-debug type is transitively referenced by a whitelisted item
When the no-debug type is explicitly whitelisted
When the no-debug type is marked opaque
The text was updated successfully, but these errors were encountered: