Commit Graph

45907 Commits

Author SHA1 Message Date
Allan Shortlidge
f774d4a3b3 Merge pull request #82151 from tshortli/rhombicuboctahedron-6.2
[6.2] Upstream support for the Xcode 26 SDKs
2025-06-10 21:57:12 -07:00
Steven Wu
15f9e0ecda Merge pull request #82069 from cachemeifyoucan/eng/PR-152441866-release
[6.2][CAS] Allow uncached job from CAS based dependency scanning
2025-06-10 11:24:44 -07:00
Pavel Yaskevich
27cd5eef15 Merge pull request #82114 from xedin/rdar-150689994-6.2
[6.2][Diagnostics] Correctly diagnose situations when immutable value is passed to `inout` parameter
2025-06-10 09:11:10 -07:00
Allan Shortlidge
aa1bce262c ModuleInterface: Canonicalize OS version numbers in loaded swiftinterfaces. 2025-06-10 08:22:38 -07:00
Allan Shortlidge
d775fddf36 AST: Warn for non-existent platform versions in @available attributes. 2025-06-10 08:22:38 -07:00
Hamish Knight
cc66fc886f [CS] Avoid solver-allocated inputs with typesSatisfyConstraint
Escaping solver-allocated types into a nested allocation arena is
problematic since we can e.g lazily compute the `ContextSubMap` for a
`NominalOrBoundGenericNominalType`, which is then destroyed when we
exit the nested arena. Ensure we don't pass any types with type
variables or placeholders to `typesSatisfyConstraint`.

rdar://152763265
2025-06-10 16:08:00 +01:00
Pavel Yaskevich
3ed55703e1 Merge pull request #82036 from xedin/rdar-151911135-6.2
[6.2][Concurrency] Fix `SendableMetatype` conformance failures to behave l…
2025-06-09 21:26:55 -07:00
Allan Shortlidge
7436be514a Merge pull request #82083 from tshortli/diagnose-unrecognized-availability-domains-as-errors-6.2
[6.2] AST: Diagnose unrecognized platforms as errors with `CustomAvailability` enabled
2025-06-09 18:16:02 -07:00
Pavel Yaskevich
1e463281b5 Merge pull request #82066 from xedin/rdar-152665294-6.2
[6.2][Demangle] Implement missing `Node::Kind::OutlinedInitializeWithTakeNoValueWitness`
2025-06-09 18:02:28 -07:00
Pavel Yaskevich
a9e5a8a07a [Diagnostics] Correctly diagnose situations when immutable value is passed to inout parameter
Currently the note is going to point to the "callee" but that is
incorrect when the failure is related to an argument of a call.

Detect this situation in `RValueTreatedAsLValueFailure::diagnoseAsNote`
and produce a correct note.

Resolves: rdar://150689994
(cherry picked from commit 6bbc101a98)
2025-06-09 09:39:12 -07:00
Adrian Prantl
957d042e1e [RemoteInspection] Add a hook to process addresses before converting
them to hex strings when creating anonymous context descriptors. This
aims to solve a problem when LLDB reads reflection metadata directly
from local binary files instead of downloading them from in-process
memory.

LLDB's MemoryReader implements this to convert the file address into
an in-process address, so mangled names created from instance metadata
can be matched with the field info data read from the local files.

rdar://152743797
(cherry picked from commit 540df142d7)
2025-06-09 08:16:04 -07:00
Allan Shortlidge
f5bae411ca AST: Diagnose unrecognized platforms as errors with CustomAvailability enabled.
When the CustomAvailability experimental feature is enabled, make it an error
to specify an unrecognized availability domain name. Also, add these
diagnostics to a diagnostic group so that developers can control their behavior
when they are warnings.

Resolves rdar://152741624.
2025-06-06 22:44:12 -07:00
Allan Shortlidge
464c37a5bb AST: Add a warning group for @_implementationOnly deprecation diagnostics.
This allows developers to control the level of these diagnostics.

Resolves rdar://152735425.
2025-06-06 19:41:42 -07:00
Steven Wu
cc0af1d4f8 [CAS] Allow uncached job from CAS based dependency scanning
Create a path that swift-frontend can execute an uncached job from
modules built with CAS based explicit module build. The new flag
-import-module-from-cas will allow an uncached build to load module
from CAS, and combined with source file from real file system to build
the current module. This allows quick iterations that bypasses CAS,
without full dependency scanning every time in between.

rdar://152441866
2025-06-06 11:08:44 -07:00
Pavel Yaskevich
fd79a85981 [Demangle] Implement missing Node::Kind::OutlinedInitializeWithTakeNoValueWitness
Implements de/remangler support for `WOB` manglings.

(cherry picked from commit 8e49860349)
2025-06-06 10:05:56 -07:00
Pavel Yaskevich
47925188ba [Concurrency] Fix SendableMetatype conformance failures to behave like Sendable ones
No warnings with minimal checking, warnings with `strict-concurrency=complete` and
if declaration is `@preconcurrency` until next major swift version.

Resolves: rdar://151911135
Resolves: https://github.com/swiftlang/swift/issues/81739
(cherry picked from commit e326cd00930ff042ba1595e7793af9aaf0208b97)
2025-06-06 08:51:05 -07:00
Pavel Yaskevich
2a3e2d0800 Merge pull request #82037 from xedin/rdar-146027395-6.2
[6.2][Concurrency] Downgrade errors to warnings when Sendable requirement is inferred from a preconcurrency protocol
2025-06-06 08:49:20 -07:00
Pavel Yaskevich
fe2c8ef00a [Diagnostics] Use contains instead of has when non-Sendable type appears inside of a member type
(cherry picked from commit 3495c61840)
2025-06-05 14:48:20 -07:00
Artem Chikin
e37071bcd4 Add a new diagnostic group and documentation for the module-not-found failure which specifies that a missing module dependency can be found on a search path serialized in another Swift binary module dependency. 2025-06-05 10:24:56 -07:00
Artem Chikin
e67be5ad7a [Dependency Scanning] Serialized Swift binary module serialized search paths 2025-06-05 10:24:50 -07:00
Artem Chikin
5dc42ffb0c [Dependency Scanning] On failure to locate a module, attempt to diagnose if binary dependencies contain search paths with this module.
Unlike with implicitly-built modules (prior to Swift 6 mode), explicitly-built modules require that all search paths be specified explicitly and no longer inherit search paths serialized into discovered Swift binary modules. This behavior was never intentional and is considered a bug. This change adds a diagnostic note to a scan failure: for each binary Swift module dependency, the scanner will attempt to execute a dependency scanning query for each serialized search path inside that module. If such diagnostic query returns a result, a diagnostic will be emitted to inform the user that the dependency may be found in the search path configuration of another Swift binary module dependency, specifying which search path contains the "missing" module, and stating that such search paths are not automatically inherited by the current compilation.
2025-06-05 10:24:43 -07:00
Pavel Yaskevich
608a37ad04 Merge pull request #81997 from xedin/using-for-default-isolation-in-file-context-6.2
[6.2][AST/Sema] SE-0478: Implement using declaration under an experimental flag
2025-06-05 00:44:21 -07:00
Doug Gregor
3604f8918c Merge pull request #81985 from DougGregor/non-sendable-metatype-capture-diag-fixes-6.2
[6.2] Minor fixes for the non-sendable meta type capture diagnostics
2025-06-04 17:59:17 -07:00
Pavel Yaskevich
e5501d485a [AST] NFC: Capitalize UsingSpecifier::nonisolated for consistency
(cherry picked from commit 21ec5924f7)
2025-06-04 13:22:34 -07:00
Pavel Yaskevich
76886eb82b [Diagnostics] Tailor using diagnostic to current use-case - default isolation
(cherry picked from commit ec9132cb5a)
2025-06-04 13:22:34 -07:00
Pavel Yaskevich
d3f8fd8fd7 [AST/Sema] Hide using declaration behind DefaultIsolationPerFile experimental feature
(cherry picked from commit c246a7a372)
2025-06-04 13:22:32 -07:00
Pavel Yaskevich
7d18588f93 [Concurrency] Add a request to retrieve default isolation of a file
The default isolation is computed based on `using` declaration
found in the file, if any.

(cherry picked from commit 36b77116bd)
2025-06-04 13:21:56 -07:00
Pavel Yaskevich
89c3b0ba41 [Parse] Implement parsing for using declarations
(cherry picked from commit 4ad27ba61e)
2025-06-04 13:16:55 -07:00
Pavel Yaskevich
8da356a1c2 [ASTGen] Implement bridging for using declaration
(cherry picked from commit 4b5105df5e)
2025-06-04 13:16:55 -07:00
Pavel Yaskevich
38ce1c230e [CodeCompletion] Implement completions in using declaration's specifier position
(cherry picked from commit 816ea9fda6)
2025-06-04 13:16:55 -07:00
Pavel Yaskevich
d057429e9a [AST] Add new declaration - using
Initially this declaration is going to be used to determine
per-file default actor isolation i.e. `using @MainActor` and
`using nonisolated` but it could be extended to support other
file-global settings in the future.

(cherry picked from commit aabfebec03)
2025-06-04 13:16:55 -07:00
nate-chandler
4225fbc5c8 Merge pull request #81959 from nate-chandler/cherrypick/release/6.2/rdar152431332
6.2: [DestroyAddrHoisting] Skip init_enum_data_addrs.
2025-06-04 10:42:21 -07:00
Doug Gregor
ed29e1fdcd Merge pull request #81934 from DougGregor/break-isolated-conformance-reference-cycle-6.2
Split conformance isolation request to eliminate a reference cycle
2025-06-04 10:26:52 -07:00
Doug Gregor
c1358c5b22 Add a diagnostic group for the diagnostic about non-Sendable metatypes.
This is a new restriction that folks are sure to run into, so provide
it with some actionable documentation. Fixes rdar://152450956.

(cherry picked from commit 9f0dda5417)
2025-06-04 09:48:38 -07:00
Pavel Yaskevich
6e9d97e273 Merge pull request #81945 from xedin/various-diagnostic-fixes-6.2
[6.2][Diagnostics] A collection of diagnostic fixes/improvements
2025-06-03 19:57:44 -07:00
Konrad `ktoso` Malawski
2e36f9139b Merge pull request #81900 from ktoso/pick-wip-fix-for-real-ptr-auth 2025-06-04 08:50:00 +09:00
Nate Chandler
5af84375f2 [MemAccessUtils] Add to strip access storage casts
The new function stripAccessAndAccessStorageCasts is analogous to the
existing function stripAccessAndIdentityCasts but differs in that the
latter uses isAccessStorageIdentityCast whereas the new function uses
isAccessStorageCast.
2025-06-03 15:54:11 -07:00
Nate Chandler
f99d542351 [MemAccessUtils] This instruction changes the type
moveonlywrapper_to_copyable_box changes the type so it's a type cast not
an identity cast.
2025-06-03 15:54:11 -07:00
Allan Shortlidge
5ee57368ae Merge pull request #81932 from tshortli/visionos-availability-remap-regression-6.2
[6.2] AST/Sema: Fix remapping of iOS availability in diagnostics for visionOS
2025-06-03 13:30:35 -07:00
Meghana Gupta
20ff6af60a Merge pull request #81917 from meg-gupta/fixdeserializationcp
[6.2] Fix deserialization of lifetime dependencies on ast function types
2025-06-03 10:51:57 -07:00
Pavel Yaskevich
143931ac08 [CSSimplify] Increase impact of a generic argument mismatch if mismatch is contextual
If generic arguments mismatch ends up being recorded on the result
of the chain or `try` expression it means that there is a contextual
conversion mismatch.

For optional conversions the solver currently generates a disjunction
with two choices - bind and optional-to-optional conversion which is
anchored on the contextual expression. If we can get a fix recorded
there that would result in a better diagnostic. It's only possible
for optional-to-optional choice because it doesn't bind the
variable immediately, so we need to downgrade direct fixes to prevent
`bind` choice from considered better.

(cherry picked from commit 65e83a8bb1)
2025-06-03 09:33:13 -07:00
Pavel Yaskevich
0f1cce3d4f [Diagnostics] Assign missing member eagerly when there is no context
Without contextual information it won't be possible to bind a missing
member to a concrete type later, so let's bind them eagerly and propagate
placeholders outward.

Resolves: rdar://152021264
Resolves: https://github.com/swiftlang/swift/issues/81770
(cherry picked from commit 10186d664b)
2025-06-03 09:33:13 -07:00
Meghana Gupta
3688f5f358 Merge pull request #81916 from meg-gupta/fixdiagnosticscp
[6.2] Fix diagnostic messages for some cases of invalid lifetime depenndencies
2025-06-03 05:45:59 -07:00
Artem Chikin
784a506374 Merge pull request #81912 from artemcm/FixImplicitBuildCXXInteropCycle_62
[6.2 🍒][C++Interop] Do not query C++ Standard Library Swift overlays when building Swift modules which were built without C++ interop
2025-06-02 23:59:38 -07:00
Doug Gregor
a3dd168435 Split conformance isolation request to eliminate a reference cycle
Inference of conformance isolation needs to check whether all of the
witnesses are nonisolated. However, witness checking looks at
conformance isolation. To break this reference cycle, split the
conformance isolation request into two requests: a "raw" request that
looks at explicitly-specified isolation, and the existing one that
also performs inference. The existing one builds on the "raw" one, as
does a separate path for the conformance checker.

Fixes rdar://152461344.
2025-06-02 23:43:29 -07:00
Allan Shortlidge
5b79f61414 AST/Sema: Fix remapping of iOS availability in diagnostics for visionOS.
When compiling for visionOS, iOS availability attributes are remapped into the
visionOS availability domain automatically. While the version remapping was
being performed correctly, there was a regression that caused the platform name
to be printed incorrectly in many diagnostics. Whenever an iOS version is
remapped to a visionOS version, availability diagnostics will now present
those versions as visionOS versions instead of iOS versions.

Resolves rdar://146293165.
2025-06-02 22:56:47 -07:00
Meghana Gupta
637f8ef03e [6.2] Fix deserialization of lifetime dependencies on ast function types 2025-06-02 17:36:22 -07:00
Artem Chikin
cf36c4419e Merge pull request #81876 from artemcm/BridgeHeaderScanDiagnostics_62
[6.2 🍒][Dependency Scanning] Bridge diagnostics emitted during bridging header scanning
2025-06-02 16:51:26 -07:00
Meghana Gupta
ea35d41f2a [6.2] Fix diagnostic messages for some cases of invalid lifetime dependencies
The diagnostic messages were misleading and suggested an invalid alternative.

rdar://151810577
2025-06-02 16:04:13 -07:00
Artem Chikin
5749ef3c14 Hard-code the 'Darwin' module as having been built without C++ interop
Textual interfaces for 'Darwin' built with recent compilers specify that it is built witout C++ interop enabled. However, to ensure compatibility with versions of the 'Darwin' module built with older compilers, we hard-code this fact. This is required to break the module cycle that occurs when building the 'Darwin' module with C++ interop enabled, where the underlying 'Darwin' clang module depends on C++ standard library for which the compiler brings in the 'CxxStdlib' Swift overlay, which depends on 'Darwin'.
2025-06-02 14:17:53 -07:00