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
Several changes:
- shorten the warning at the call-site of unannotated functions that
return FRTS
- place the call to action ("annotate 'X' with 'Y'") at the diagnostic
note attached to the unannotated callee, where the annotation should
be made
- re-word the foreign-reference-type.md documentation to (1) reflect the
diagnostic wording change, (2) give a little bit more background about
why the annotations are needed, and (3) not be specific to C++ (since
we can import FRTs from C as well)
This is mostly just cleanup:
1. Removes `diagnostic-descriptions.md` since it isn't used any more
2. Adds the group name to all the old notes files
3. Removes trailing whitespace
4. Adds "See Also" sections for notes that have links
- Delete baseline language feature WarnUnannotatedReturnOfCxxFrt,
which won't really be useful to users
- Remove some references to "cxx", since FRTs are not exclusively
imported from C++
- Clean up lit test RUN lines to use %{fs-sep}
This change makes the warning for unannotated C++ functions returning foreign
reference types (FRT) enabled by default, improving memory safety for Swift/C++
interop users. Also added CxxForeignReferenceType diagnostic group for better control
This check will run on each type-checked primary input of the current compilation and emit a warning diagnostic for all discovered occurences of this code pattern when the performance hint diagnostic is enabled
A "permanently enabled" availability domain is one that has been declared
always available and is also simultaneously has either an attribute that
makes it deprecated or universally unavailable.
Emit fix-its that remove (or update) `@available` attributes that restrict
availability in a permanently enabled domain. Also, emit warnings about
`if #available` queries that always return true because they check a
permanently enabled domain.
Resolves rdar://157601761.