Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.
To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.
rdar://129283608
The isolation checker was assuming that one can only be isolated to a
specific var, but that's not true for distributed actors -- because the
default parameter emitted by #isolation is a method call -- converting
the self into an any Actor.
We must handle this in isolation checker in order to avoid thinking
we're crossing isolation boundaries and making methods implicitly async
etc, when we're actually not.
resolves rdar://131874709
It cannot be used for executing general-purpose work, because such function would need to have a different signature to pass isolated actor instance.
And being explicit about using this method only for deinit allows to use object pointer for comparison with executor identity.
This is in order to avoid errors in complete concurrency checking mnode
in distributed funcs, or rather their thunks, as there is isolation
boundary crossing happening when we pass a value to a distributed func.
This is because as we do this, we pass it to a nonisolated thunk:
```
nonisolated func THUNK(param: Thing) {
if remote {
...
} else {
await self.realFunc(param)
}
}
```
So what happens here is that the Thing would become isolated to the
task and we get a bad isolation crossing as we pass it along to the
"real func".
Sending values into the distributed thunk is the right thing to do to
resolve this problem: `nonisolated func THUNK(param: sending Thing) {}`
Resolves rdar://126577527
Obsoleting `AnyActor` in Swift 6 blocks the Concurrency library itself
from migrating to Swift 6, because `Actor` and `DistributedActor` have to
preserve their refinement of `AnyActor` to avoid breaking code currently
using the marker protocol. There's no way to move protocol refinement into
an extension so that the use-site declaration can be obsoleted, so we're
stuck with just the deprecation of `AnyActor`.
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`.