Implement customizable Sendable conformance diagnostics.

Rework Sendable checking to be completely based on "missing"
conformances, so that we can individually diagnose missing Sendable
conformances based on both the module in which the conformance check
happened as well as where the type was declared. The basic rules here
are to only diagnose if either the module where the non-Sendable type
was declared or the module where it was checked was compiled with a
mode that consistently diagnoses `Sendable`, either by virtue of
being Swift 6 or because `-warn-concurrency` was provided on the
command line. And have that diagnostic be an error in Swift 6 or
warning in Swift 5.x.

There is much tuning to be done here.
This commit is contained in:
Doug Gregor
2021-08-11 00:14:50 -07:00
parent 392ba002c8
commit d54abea922
28 changed files with 437 additions and 223 deletions

View File

@@ -501,6 +501,9 @@ public:
/// .swiftsourceinfo file (ie. the file exists and has been read).
bool hasSourceInfo() const { return Core->hasSourceInfo(); }
/// \c true if this module was built with complete checking for concurrency.
bool isConcurrencyChecked() const { return Core->isConcurrencyChecked(); }
/// Associates this module file with the AST node representing it.
///
/// Checks that the file is compatible with the AST module it's being loaded