Don’t recommend @preconcurrency on audited imports

If a type is explicitly non-Sendable, we don’t want to recommend softening errors with `@preconcurrency import` (even thought that would still work), because these probably represent *real* errors that you ought to fix. And at the extreme end of this, if a module is built with `-warn-concurrency` or `-swift-version 6`, *all* of its types should be treated as though they have explicit sendability, since we assume the entire module has been audited.

(Eventually, we plan to do this at module build time by actually serializing out unavailable conformances rather than by looking at the settings used to build the module, but we aren’t there quite yet.)

Implement this and test it by checking that the preconcurrency sendable tests never recommend adding `@preconcurrency` to an import of `StrictModule`, even when we do the same illegal things with it that cause that remark to be printed for `NonStrictModule`.
This commit is contained in:
Becca Royal-Gordon
2022-04-07 19:13:08 -07:00
parent 4caaa3bf24
commit 9cbac44031
5 changed files with 54 additions and 40 deletions

View File

@@ -1 +1,3 @@
public struct StrictStruct: Hashable { }
open class StrictClass { }