[Exclusivity] Disable dynamic enforcement in noescape closures. #9479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CCC
Explanation: Fully checking the exclusivity model requires enabling dynamic checks. We can't allow false positives, especially in a common case like mutation with a noescape closure. Instead we claim that these checks are currently incomplete for accesses within noescape closure. In the near future, once the lagnuage proposal is fully accepted, we will implement static checking of noescape closures. Static checking these cases is far superior for many reasons in addition to avoiding false positives.
Scope: Only affects -enforce-exclusivity=checked, which is purely opt-in.
Radar: rdar://problem/32119357 [Exclusivity] Disable dynamic enforcement in noescape closures.
Risk: Some code that violates the exclusivity model will pass without failure until static enforcement is enabled. This engenders a false sense of security.
Testing: All applications that have already been tested with enforcement need to be retested.