You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --no-default <regex> and Builder::no_default(String) to supply regexes for matching against types that we should not derive or implement Default for.
Adding this feature involves:
Adding a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set).
A Builder method to add strings to that RegexSet.
Plumbing in src/options.rs to convert --no-default <regex> CLI flags into invocations of the builder method.
Making the MonotoneFramework::constrain function in src/ir/analysis/derive_default.rs check if the given item is explicitly marked not to be Default, and if so, inserting it into the self.cannot_derive_default set via return self.insert(id).
Tests!
When the no-default type is transitively referenced by a whitelisted item
When the no-default type is explicitly whitelisted
When the no-default type is marked opaque
The text was updated successfully, but these errors were encountered:
Add
--no-default <regex>
andBuilder::no_default(String)
to supply regexes for matching against types that we should not derive or implementDefault
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-default <regex>
CLI flags into invocations of the builder method.Making the
MonotoneFramework::constrain
function insrc/ir/analysis/derive_default.rs
check if the given item is explicitly marked not to beDefault
, and if so, inserting it into theself.cannot_derive_default
set viareturn self.insert(id)
.Tests!
When the no-default type is transitively referenced by a whitelisted item
When the no-default type is explicitly whitelisted
When the no-default type is marked opaque
The text was updated successfully, but these errors were encountered: