-
Notifications
You must be signed in to change notification settings - Fork 776
Description
Add --no-copy <regex> and Builder::no_copy(String) to supply regexes for matching against types that we should not derive or implement Copy 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-copy <regex>CLI flags into invocations of the builder method. -
Making the
MonotoneFramework::constrainfunction insrc/ir/analysis/derive_copy.rscheck if the given item is explicitly marked not to beCopy, and if so, inserting it into theself.cannot_derive_copyset viareturn self.insert(id). -
Tests!
-
When the no-copy type is transitively referenced by a whitelisted item
-
When the no-copy type is explicitly whitelisted
-
When the no-copy type is marked opaque
-