Commit Graph

36 Commits

Author SHA1 Message Date
Anthony Latsis
f85eb97337 ConformanceChecker: Make actor_isolated_witness call out the protocol 2025-01-14 14:49:22 +00:00
Allan Shortlidge
75bad99f78 Tests: Remove -disable-availability-checking in Distributed tests.
Use the `%target-swift-5.X-abi-triple` substitutions to compile the tests for
deployment to the minimum OS versions required for the APIs used in the tests,
instead of disabling availability checking.
2024-10-20 09:07:13 -07:00
Doug Gregor
5a0e70a2bc Update diagnostic text to address code review feedback 2024-05-20 22:06:40 -07:00
Doug Gregor
640042f396 Suggest @preconcurrency on conformances it could help
When diagnosing a case where an actor-isolated witness cannot satisfy
a non-isolated requirement, also suggest that the conformance could be
annotated with `@preconcurrency`.
2024-05-20 22:06:40 -07:00
Anthony Latsis
14b70f306b DiagnosticVerifier: Default expected fix-it start line to the diagnostic's 2023-03-08 12:10:27 +03:00
Konrad `ktoso` Malawski
728c007fb9 [Distributed] Implement witnesses for sync or non-throw dist reqs
[Distributed] generic and inner test; without one edge case

[Distributed] fix distributed_thunk test; unsure about those extra hops, could remove later

[Distributed] Remove type pretending in getSILFunctionType; it is not needed

It seems our constant replacement in the earlier phases is enough, and
we don't need this trick at all.

[Distributed] Use thunk when calling cross-actor on DA protocols
2022-07-04 19:02:11 +09:00
Konrad `ktoso` Malawski
22b20afce6 [Distributed] make witness be the distributed thunk 2022-06-27 17:08:55 +09:00
Doug Gregor
774a94f69d Make sure we can dig out the (distributed) actor from an archetype.
Fixes #59356 / rdar://94976378.
2022-06-14 10:57:29 -07:00
Konrad `ktoso` Malawski
8e6d72190c [Distributed] Further witness checking cleanup and tests 2022-06-14 14:12:39 +09:00
Konrad `ktoso` Malawski
911b42f597 workaround for #59356 while still implementing the witness feature 2022-06-10 21:17:37 +09:00
Konrad `ktoso` Malawski
bd052eedd7 improve FIXME to link to issue 2022-06-10 13:41:37 +09:00
Konrad `ktoso` Malawski
7792a3127b [Distributed] Implement missing case in permitting witnesses 2022-06-10 12:46:33 +09:00
Doug Gregor
a8e16297a9 Sendable checking for overrides.
When an override means crossing an actor boundary, check Sendability of
parameters and results.
2022-05-25 15:17:47 -07:00
Luciano Almeida
d95cd97703 [Sema] Improving implicit closure capture diagnostic wording 2022-05-24 20:49:45 -03:00
Doug Gregor
4116d7a3d7 Rename the -strict-concurrency= options to be more descriptive.
The three options are now:

* `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default)
* `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable.
* `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
2022-04-20 18:17:33 -07:00
Doug Gregor
f404b58b96 Add -strict-concurrency=limited to tests that specifically need it.
This isolates us from changes in the default.
2022-04-20 09:11:10 -07:00
Doug Gregor
fdc6260bc1 Reimplement conformance isolation checking using the actor reference logic.
Reimplement the final client of ActorIsolationRestriction, conformance
isolation checking, to base it on the new "actor reference" logic.
Centralize the diagnostics emission so we have a single place where we
emit the primary diagnostic (which is heavily customized based on
actor isolation/distributed/etc.) and any relevant notes to make
adjustments to the witness and/or requirement, e.g., adding
'distributed', 'async', 'throws', etc. Improve the diagnostics
slightly by providing Fix-Its when suggesting that we add "async"
and/or "throws".

With the last client of ActorIsolationRestriction gone, remove it
entirely.
2022-04-07 17:10:02 -07:00
Konrad `ktoso` Malawski
8c13370242 [Distributed] rename _Distributed to underscoreless module 2022-03-16 08:35:35 +09:00
Konrad `ktoso` Malawski
13cc8b3157 [Distributed] Enable no-longer-experimental distributed by default 2022-03-11 22:14:49 +09:00
Konrad `ktoso` Malawski
c57cb45eac [Distributed] Handle SerializationRequirement in dist get props
- reuse more code about getting the type and requirements
- handle protocols properly, including extensions with where clauses
- improve error messages
2022-02-08 23:08:59 +09:00
Doug Gregor
1647cdd04c Merge pull request #40602 from DougGregor/sendable-diagnostics 2021-12-16 21:58:38 -08:00
Doug Gregor
a901892a1c Update test 2021-12-16 17:09:41 -08:00
Doug Gregor
536b0367dd Merge pull request #40560 from DougGregor/conformance-cross-actor-sendable-checks 2021-12-14 23:08:14 -08:00
Doug Gregor
7db313bd35 Fix test case 2021-12-14 20:04:57 -08:00
Konrad `ktoso` Malawski
cee89ec541 [Distributed] DistributedActorSystem renaming and redesign (#40387)
* [Distributed] towards DistributedActorSystem; synthesize the id earlier, since Identifiable.id

* Fix execute signature to what Pavel is working with

* funcs are ok in sil

* fixed lifetime of id in inits

* fix distributed_actor_deinit

* distributed_actor_local

* update more tests

fixing tests

fix TBD test

fix Serialization/distributed

fix irgen test

Fix null pointer crashes

* prevent issues with null func ptrs and fix Distributed prorotocol test

* fix deinit sil test
2021-12-13 11:29:25 +09:00
Konrad `ktoso` Malawski
069942eed7 [Distributed] Improve error message style 2021-11-16 21:09:35 +09:00
Konrad `ktoso` Malawski
f58b133a84 [Distributed] adjust conformance error messages a bit 2021-11-15 11:11:55 +09:00
Doug Gregor
04cd00e325 Update distributed tests for diagnostic change 2021-11-05 07:44:18 -07:00
Konrad `ktoso` Malawski
61a1bc2a6c [Distributed] remove public default AnyActorTransport alias
The previously set public AnyActorTransport was a temporary thing,
and instead we want to set this in every module that declares such
actors.
2021-11-04 15:54:56 +09:00
Konrad `ktoso` Malawski
841bd4260a [Concurrency][Distributed] Handle more cases of isolation, protocols, better errors (#39895)
* [Distributed] Handle more cases of isolation, protocols, better errors/notes

* [Concurrency] Actor sync funcs can conform to async protocol reqs

* [Distributed] Offer fixit to add DistributedActor to type when dist func is encountered

* [Distributed] Witness protocol reqs in dist actor protocol extensions

* try to address availability issues
2021-11-01 19:13:33 +09:00
Karoy Lorentey
5e78c3bfdc [Distributed] Restore availability macro definitions & update to 5.6
The _Distributed module is being introduced in Swift 5.6, so its definitions need to come with matching availability. (We don't have version numbers for the associated OS releases, so we need to use placeholder 9999 availability for these.)
2021-10-28 16:41:37 -07:00
Karoy Lorentey
47956908b7 [Concurrency] SwiftStdlib 5.5 ⟹ SwiftStdlib 5.1 (usages)
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.

Adjust macro usages accordingly.
2021-10-28 14:36:36 -07:00
Doug Gregor
7e2469fe87 Remove unnecessary 'distributed' checks in actor isolation code.
Remove a few places where we are introducing extra distributed-related
actor isolation checking that either isn't necesssary or is incorrect.
Specifically:

* Hopping to a global actor *from* a distributed-actor isolated context
does not go through a distributed thunk (global actors can't have one).
* "Unrestricted" declarations are always unrestricted, so we don't
need an extra distributed check here (it won't ever occur).
* Actor isolation computation doesn't need a special case for
distributed; it marks too much, overriding (e.g.) global actor
isolation.

The primary semantic change visible here is that distributed actors
can now have truly 'nonisolated' members. They aren't required to be
'distributed' because they can't touch state anyway.
2021-10-01 21:59:48 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Konrad `ktoso` Malawski
716a0255c0 [Distributed] Move to ActorIdentity protocol (#38362) 2021-07-15 21:13:55 +09:00
Konrad `ktoso` Malawski
ae9e320215 [Distributed] Handle distributed func witnessess from distributed actor protocols (#38269)
* [Distributed] Handle distributed func witnessess from distributed actor protocols

* [Distributed] Implement dist protocol and nonisolated handling

* revert additional warning check

* [Distributed] Ban mixing nonisolated and distributed on func

* [Distributed] handle nonisolated in distributed contexts
2021-07-12 19:18:20 +09:00