If the module named in `#if canImport(<Module>, _version: ...)` cannot be
found, it may indicate that the developer misspelled the module name. Emit a
warning to indicate that the directive evaluates to false. If it is intentional
that the module not be found, the developer can avoid the warning by first
checking whether the module can be imported and then check its version.
Resolves rdar://128367758.
The initial IPI implementation emits an error when an api/spi-level
module publicly imports an ipi-level module. That is too aggressive for
incremental adoption.
Wrap the diagnostic in a new diagnostic group (IPIVerification) and emit
it as a warning.
Also reword the message from "...from non-internal module 'X'" to a clearer
"...because 'X' has '-library-level api/spi'"
rdar://178560797
"Task-isolated" is an internal implementation term that is not meaningful
to users. Replace it with the user-facing "code in the current isolation context"
formulation throughout region-based isolation diagnostics.
Diagnostic definitions in DiagnosticsSIL.def are updated to accept an
additional bool parameter for task-isolation and use %select to choose
between the actor-isolation string and "code in the current isolation context".
Emission sites in SendNonSendable.cpp are updated to pass
isTaskIsolated() at each call site. All affected test expectations are
updated to match the new output.
rdar://178534037
Allow developers to control the behavior of warnings like this:
```
let x = 0
if case _ = x { // warning: 'if' condition is always true
// ...
}
```
Resolves rdar://178154296.
Introduce two new diagnostic groups: RegionIsolationCrossIsolationDataRace
and RegionIsolationUnknownPattern, both linked as children of the existing
RegionIsolation group. This converts the merge-region-failure errors and the
unknown-pattern error from plain ERROR to GROUPED_ERROR, which allows users
to selectively downgrade these diagnostics (e.g. the unknown pattern error
can be downgraded since it represents a compiler limitation rather than a
definite user error).
Add user-facing documentation for both groups explaining what triggers the
diagnostics and how to resolve them.
rdar://175771878
Adds every diagnostic in the legacy `no-usage` diagnostic category to a new
diagnostic group called NoUsage so that the diagnostics can participate in
diagnostic control mechanisms like `-Werror`.
Resolves rdar://160488389.
Pending swift evolution discussion: https://github.com/swiftlang/swift-evolution/pull/3133
replaces #87171
update new error message according to proposal
also handle untyped throws in _nonDiscardableWhenThrowing attr
Rename the internal attr _nonDiscardableWhenThrowingOperation
Makes it possible for users of `-warnings-as-errors` to control the behavior of
warnings about the obsoletion of module interface emission options.
Resolves rdar://174787052.
This commit fixes rdar://166895453 by recognizing unavailable
conformances even for `@unchecked @retroactive` extensions. It also adds
a userdoc to explain unavailable conformances.
Fixes rdar://89864078, by checking if all the required vars are
immutable, and suggesting mutable variables be converted to immutable to
become nonisolated and presumably fix the isolation issue. Also suggests
'nonisolated' on var decls without storage or wrapper. Additionally,
converts existing 'nonisolated' for method suggestion to emit per-method
instead of a top level 'all', for consistency with the new diagnostic,
based on PR feedback.
Enabling `UseAnyAppleOSAvailability` diagnostics will cause the compiler to
diagnose declarations where `anyAppleOS` availability can be used a concise
replacement for platform-specific availability annotations.
Resolves rdar://163819878.
Fixes rdar://145127274 by adding a note that hints at why this cannot be
accepted, and a diagnostic group that spells out the correctness problem
created by the implicit inout self from mutating async methods.
Untyped throws requires a heap allocation and reference counting for
thrown errors, which can be unacceptable in very
performancce-constrained environments. Introduce a new subgroup of
performance hints, UntypedThrows, to report uses of untyped throws.
This resurrects the code we were using for diagnosing untyped throws
in Embedded Swift, repurposing it as a performance hint, which is more
appropriate.
It is plausible that we will introduce support for untyped throws in
Embedded Swift at some point, so don't diagnose its presence so
eagerly now. Instead, leave it until later in the pipeline when it's
actually used.
Fixes rdar://162071067, where we were getting entirely too many
warnings about this.
When building the `OSLog` module, look for a variable named
`osLogStringSectionName`. It must have a string literal as its
initializer, which provides the section name where the log strings
should be emitted. The `OSLog` module should contain something like
this:
let osLogStringSectionName = "__TEXT,__logit"
When not present, the compiler will default to
`__TEXT,__oslogstring,cstring_literals`, which was previously the
hardcoded section name. Now, OSLog can customize the name.
Implements rdar://171571056
Always run explicit `Sendable` checks on public types and suppress
warning printing by default instead of using a special compiler argument.
Resolves: rdar://162394810