mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -812,6 +812,7 @@ void Serializer::writeBlockInfoBlock() {
|
||||
BLOCK_RECORD(options_block, RESILIENCE_STRATEGY);
|
||||
BLOCK_RECORD(options_block, IS_ALLOW_MODULE_WITH_COMPILER_ERRORS_ENABLED);
|
||||
BLOCK_RECORD(options_block, MODULE_ABI_NAME);
|
||||
BLOCK_RECORD(options_block, IS_CONCURRENCY_CHECKED);
|
||||
|
||||
BLOCK(INPUT_BLOCK);
|
||||
BLOCK_RECORD(input_block, IMPORTED_MODULE);
|
||||
@@ -1026,6 +1027,11 @@ void Serializer::writeHeader(const SerializationOptions &options) {
|
||||
ABIName.emit(ScratchRecord, M->getABIName().str());
|
||||
}
|
||||
|
||||
if (M->isConcurrencyChecked()) {
|
||||
options_block::IsConcurrencyCheckedLayout IsConcurrencyChecked(Out);
|
||||
IsConcurrencyChecked.emit(ScratchRecord);
|
||||
}
|
||||
|
||||
if (options.SerializeOptionsForDebugging) {
|
||||
options_block::SDKPathLayout SDKPath(Out);
|
||||
options_block::XCCLayout XCC(Out);
|
||||
|
||||
Reference in New Issue
Block a user