-
Notifications
You must be signed in to change notification settings - Fork 745
[Close #961] Add --no-debug <regex> flag #1190
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
Conversation
r? @pepyakin |
Thanks for your pull request! Sorry for not getting to this earlier! Looks like there are some tests are failing because of headers differs from expectations, but the only difference I can see is formatting! Looks strange, do you know guys what's going on @emilio / @fitzgen ? Also, looks like Aside of that, your PR looks great! |
Its possible that we need to re-run |
Thanks guys, I have just opened this PR to ensure I am on the right way. |
I am not sure about why tests failed. I installed the same version locally and experimented on a file
But if I run
it doesn't reformat I don't know where |
☔ The latest upstream changes (presumably #1330) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm closing this PR as the merged PR #1858 was based over this one.. |
Close #961
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