[Concurrency/Distributed] ensure distributed thunks are @concurrent

Otherwise the "nonisolated nonsending by default" mode blows up as
distributed thunk signatures dont match expectations.

This undoes the fix from https://github.com/swiftlang/swift/pull/83940
and applies the fix on the synthesis side of the distributed thunks,
such that they are @concurrent always -- which keeps their old semantics
basically, regardless of what "default" mode we have.
This commit is contained in:
Konrad Malawski
2025-09-03 18:23:59 +09:00
parent 1b856e1fc9
commit ced1756142
3 changed files with 22 additions and 12 deletions

View File

@@ -737,8 +737,11 @@ static FuncDecl *createSameSignatureDistributedThunkDecl(DeclContext *DC,
thunk->setSynthesized(true);
thunk->setDistributedThunk(true);
// TODO(distributed): These would benefit from becoming nonisolated(nonsending)
thunk->getAttrs().add(NonisolatedAttr::createImplicit(C));
// TODO(distributed): It would be nicer to make distributed thunks nonisolated(nonsending) instead;
// this way we would not hop off the caller when calling system.remoteCall;
// it'd need new ABI and the remoteCall also to become nonisolated(nonsending)
thunk->getAttrs().add(new (C) ConcurrentAttr(/*IsImplicit=*/true));
return thunk;
}