-
Notifications
You must be signed in to change notification settings - Fork 776
Description
Add --no-debug <regex> and Builder::no_debug(String) to supply regexes for matching against types that we should not derive or implement Debug for.
Adding this feature involves:
-
Adding a new
RegexSetmember tobindgen::Builder(similar to thewhitelisted_typesset). -
A
Buildermethod to add strings to thatRegexSet. -
Plumbing in
src/options.rsto convert--no-debug <regex>CLI flags into invocations of the builder method. -
Making the
MonotoneFramework::constrainfunction insrc/ir/analysis/derive_debug.rscheck if the given item is explicitly marked not to beDebug, and if so, inserting it into theself.cannot_derive_debugset viareturn self.insert(id). -
Skipping any item explicitly marked not to be
Debuginsrc/codegen/derive_debug.rsso that we don't generate animpl Debug for ...for these types when--impl-debugis passed. -
Tests!
-
When
--impl-debugis also supplied -
When
--impl-debugis not also supplied -
When 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
-