Commit Graph

1087 Commits

Author SHA1 Message Date
Nate Chandler
ed5c7ef7ae [BitwiseCopyable] Promote to feature.
SE-0426 was accepted.
2024-04-24 15:52:20 -07:00
Alexis Laferrière
fd59933ff5 Merge pull request #73179 from xymus/deprecated-impl-only
Sema: Warn that resilient uses of `@_implementationOnly` are deprecated
2024-04-23 09:22:12 -07:00
Kavon Farvardin
04e100dc0d Merge pull request #73131 from kavon/rdar126730410
NCGenerics: omit flag in interfaces
2024-04-22 14:18:50 -07:00
Alexis Laferrière
0a25248e4b Test: Expect warning on deprecated @_implementationOnly in tests 2024-04-22 13:08:20 -07:00
Kavon Farvardin
c8e92fa23e Fix expected NoncopyableGenerics guards 2024-04-22 11:13:40 -07:00
Alexis Laferrière
a890d8fded Sema: Remove internal imports by default from Swift 6
The language steering group has decided to revert their previous
decision and remove this feature from Swift 6.

rdar://126318567
2024-04-19 12:19:29 -07:00
Kavon Farvardin
dc88c0a902 remove suppression disablement workaround 2024-04-19 11:34:01 -07:00
Kavon Farvardin
6050a96bd0 Update additional tests after flag change
rdar://126730410
2024-04-19 09:05:05 -07:00
nate-chandler
b00b5aad4f Merge pull request #72646 from nate-chandler/bitwise-copyable/20240327/1
[BitwiseCopyable] Allow suppression via ~.
2024-04-18 07:05:10 -07:00
Pavel Yaskevich
7b8f76e3c4 Merge pull request #73007 from xedin/promote-dynamic-actor-isolation-to-upcoming-feature
[SE-0423] Promote `DynamicActorIsolation` to an upcoming feature and add a way to disable checks
2024-04-16 11:46:41 -07:00
Nate Chandler
ba467d2bd2 [Sema] Enable suppression of inferred conformances.
Add the machinery to support suppression of inference of conformance to
protocols that would otherwise be derived automatically.

This commit does not enable any conformances to be suppressed.
2024-04-15 16:46:22 -07:00
Artem Chikin
01d891ad99 Merge pull request #72834 from artemcm/UpstreamVisionOS
Introduce visionOS Platform
2024-04-15 09:33:49 -07:00
Pavel Yaskevich
3a0acf8043 [AST/Sema] Decouple @preconcurrency conformances from DynamicActorIsolation feature flag 2024-04-14 21:28:13 -07:00
Pavel Yaskevich
03e9d4258e [Frontend] NFC: Promote DynamicActorIsolation to an upcoming feature flag 2024-04-14 21:28:13 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Kavon Farvardin
179bc4b605 Merge pull request #72820 from kavon/conditional-copyable-restriction
NCGenerics: restrict conditional Copyable reqs
2024-04-09 17:56:34 -07:00
nate-chandler
734da620e6 Merge pull request #72929 from nate-chandler/rdar126135770
[BitwiseCopyable] Don't infer for noncopyable.
2024-04-09 13:54:48 -07:00
treastrain / Tanaka Ryoga
a1c49d0139 @Observable Macro supports properties with the package access modifier (#71061)
* `@Observable` Macro supports properties with the `package` access modifier #71060

* Cherry-pick "Move the tests for package scopes to the module interface tests" 4e274ce0a5

---------

Co-authored-by: Philippe Hausler <phausler@apple.com>
2024-04-09 13:32:03 -07:00
Nate Chandler
bd4809593b [BitwiseCopyable] Don't infer for noncopyable.
This bailout was accidentally removed in
https://github.com/apple/swift/pull/72856 when removing a duplicative
diagnostic.

rdar://126135770
2024-04-09 07:50:36 -07:00
Steven Wu
0e12f2042e [ScanDependency] Move binary module validation into scanner
Improve swift dependency scanner by validating and selecting dependency
module into scanner. This provides benefits that:
* Build system does not need to schedule interface compilation task if
  the candidate module is picked, it can just use the candidate module
  directly.
* There is no need for forwarding module in the explicit module build.
  Since the build system is coordinating the build, there is no need for
  the forwarding module in the module cache to avoid duplicated work,
* This also correctly supports all the module loading modes in the
  dependency scanner.

This is achieved by only adding validate and up-to-date binary module as
the candidate module for swift interface module dependency. This allows
caching build to construct the correct dependency in the CAS. If there
is a candidate module for the interface module, dependency scanner will
return a binary module dependency in the dependency graph.

The legacy behavior is mostly preserved with a hidden frontend flag
`-no-scanner-module-validation`, while the scanner output is mostly
interchangeable with new scanner behavior with `prefer-interface` module
loading mode except the candidate module will not be returned.

rdar://123711823
2024-04-05 07:52:14 -07:00
Kavon Farvardin
215c4e1c25 NCGenerics: restrict conditional Copyable reqs
It doesn't really make sense for a conditional conformance requirement
for `Copyable` to depend on any other requirement other than other
`Copyable` conformance requirements.

resolves rdar://124967739
2024-04-04 14:20:28 -07:00
Kavon Farvardin
30983530b6 NCGenerics: introduce SuppressedAssociatedTypes
The model for associated types hasn't been fully worked-out for
noncopyable generics, but there is some support already that is being
used by the stdlib for an internal-only (and rather cursed) protocol
`_Pointer` to support `UnsafePointer`, etc.

This patch gates the existing experimental support for associated types
behind a feature flag. This flag doesn't emit feature-guards in
interfaces, since support for it is tied closely to NoncopyableGenerics
and has been there from its early days.
2024-04-02 16:53:36 -07:00
Kavon Farvardin
554fa49a1f Test: clean-up noncopyable_generics lit usage
There no longer is a lit feature called `noncopyable_generics`, it's
just always on now.
2024-04-01 12:28:08 -07:00
Allan Shortlidge
12fccfc4e0 Frontend: Really allow any experimental feature when compiling a module interface.
The fix for https://github.com/apple/swift/pull/72632 was not sufficient
because when modules are built from textual interface that happens in a
sub-invocation which does not have typecheck-from-interface or
compile-from-interface requested action. Instead of checking a requested
action, set a language option to control whether non-production experimental
features are allowed.

Resolves rdar://125561443
2024-03-28 14:48:15 -07:00
Allan Shortlidge
590d3353e6 Frontend: Introduce an alias for the IsolatedAny experimental feature.
To preserve compatibility with older compilers that do not allow `IsolatedAny`
to be enabled in production compilers, use an alias experimental feature when
building the stdlib (`IsolatedAny2`).

Also, add `@_allowFeatureSuppression(IsolatedAny)` in a couple spots it was
forgotten.

Partially resolves rdar://125138945
2024-03-27 22:20:50 -07:00
Allan Shortlidge
37034282a1 stdlib: Adopt @_disallowFeatureSuppression(NoncopyableGenerics).
This prevents some re-declaration errors when building the standard library
from its `.swiftinterface` with older compilers.
2024-03-27 22:20:50 -07:00
Allan Shortlidge
ee73ff7737 AST: Adjust declaration printing when NoncopyableGenerics2 is suppressed.
When printing declarations with `NoncopyableGenerics2` suppressed we must avoid
printing the `@_preInverseGenerics` attribute and any `borrowing` or
`consuming` parameter ownership modifiers.
2024-03-27 22:20:49 -07:00
Allan Shortlidge
b11b64273b Frontend: Allow any experimental feature to be enabled when compiling a module.
When building a module from its interface, do not diagnose whether or not a
feature is available in production compilers. This is important since older
compilers may be expected to build .swiftinterfaces that were produced by newer
compilers where the feature has been enabled by default.

Resolves rdar://125500318
2024-03-27 11:43:48 -07:00
Allan Shortlidge
b249503a2b AST: Introduce @_disallowFeatureSuppression attribute.
This attribute is the inverse of the existing `@_allowFeatureSuppression`
attribute.

Part of rdar://125138945
2024-03-26 17:27:57 -07:00
Meghana Gupta
b5ca933002 Update lifetime dependence syntax and inference as per changes in the pitch
Pitch - https://github.com/apple/swift-evolution/pull/2305

Changes highlights:

dependsOn(paramName) and dependsOn(scoped argName) syntax

dependsOn(paramName) -> copy lifetime dependence for all parameters/self except
                         when we have Escapable parameters/self, we assign scope
                         lifetime dependence.

Allow lifetime dependence on parameters without ownership modifier.

Always infer copy lifetime dependence except when we have
Escapable parameters/self, we infer scope lifetime dependence.

Allow lifetime dependence inference on parameters without ownership modifier.
2024-03-23 18:19:47 -07:00
Alex Hoppen
4b423020e0 Merge pull request #72357 from ahoppen/ahoppen/no-disable-experimental-parser-round-trip
[Parser] Remove remaining `-disable-experimental-parser-round-trip` uses in test cases
2024-03-22 08:22:26 +01:00
Steven Wu
f71cce15cb [ScanDependency] Set context hash for source module
Set context hash for source module so swift-driver can use the hash to
compute output path if needed.

rdar://119202702
2024-03-20 10:12:17 -07:00
Karoy Lorentey
bd39c35026 [test] Un-xfail tests that are passing now that NoncopyableGenerics is a suppressible feature 2024-03-18 12:32:33 -07:00
Karoy Lorentey
68a8c41e81 [test] Temporarily XFAIL tests that expect swiftinterface files to work when using Optional and other stdlib features 2024-03-18 11:09:08 -07:00
Doug Gregor
7b1f41bcf2 Merge pull request #72362 from DougGregor/suppressible-noncopyable-generics
Make NoncopyableGenerics a suppressible feature
2024-03-15 18:05:28 -07:00
John McCall
cbf421924c Merge pull request #72347 from rjmccall/isolated-any-implies-sendable
Make `@isolated(any)` imply `@Sendable`
2024-03-15 18:49:32 -04:00
Doug Gregor
164ae687ff Make NoncopyableGenerics a suppressible feature
Emit Swift interface files that are compatible with Swift compilers that
predate the introduction of noncopyable generics.
2024-03-15 14:50:40 -07:00
Alex Hoppen
978145c61d [Parser] Remove remaining -disable-experimental-parser-round-trip uses in test cases
All the features in these test cases are now supported by the new parser, so we don’t need the opt-out anymore.

rdar://124646502
2024-03-15 12:30:40 -07:00
John McCall
590643ce5e Make @isolated(any) imply @Sendable. No avoidance mechanism for now. 2024-03-15 00:40:54 -04:00
Alexis Laferrière
3703751eae Tests: remove -experimental-spi-imports from access-level on imports test 2024-03-14 07:17:23 -07:00
Mishal Shah
1a63c3abc2 Merge pull request #65629 from edymtt/edymtt/no-arm64e-fallback-test-on-apple-silicon
Configure `ModuleInterface/arm64e-fallback` to not run in simulators
2024-03-13 23:08:27 -07:00
Ellie Shin
378884eac6 Merge pull request #72282 from apple/elsh/pkg-import-pkg-interface
Fixes package import stmt missing from .package.swiftinterface.
2024-03-13 19:35:20 -07:00
Ellie Shin
2d9042386c Fixes package import stmt missing from .package.swiftinterface.
Resolves rdar://124309585
2024-03-13 14:35:57 -07:00
Ellie Shin
bb57e4b8dd Merge pull request #71944 from apple/es-interface-client
Add back a client side test loading a package interface
2024-03-12 17:04:04 -07:00
Alexis Laferrière
c13a4c57ee Merge pull request #71617 from xymus/swiftinterface-by-default-mode
ModuleInterface: Setup logic to load distributed swiftinterfaces over swiftmodules by default
2024-03-12 07:52:15 -07:00
Ellie Shin
00938a4ea5 Add back a client side test that loads a package interface 2024-03-12 01:39:50 -07:00
Doug Gregor
e0df6e01bd Merge pull request #72234 from DougGregor/attr-implements-assoc-failure-type
[Associated type inference] Support `@_implements` on type witnesses and use it for async sequence `Failure`
2024-03-11 21:03:54 -07:00
Konrad `ktoso` Malawski
7d7673b47a [Distributed] simplify version match in test (#72242) 2024-03-11 18:52:15 -07:00
Doug Gregor
5bdd4e5772 Improve @_implements for associated type witnesses
Allow `@_implements` to be expressed in an extension of the protocol in
which the associated type is defined. Use this to uncomment an
intended use of `@_implements` in `Sequence` that could be used to
replace a longstanding hack for associated type inference.

Since this change means that the standard library module interface
won't be accepted by older compilers, introduce a suppressible feature
ssociatedTypeImplements` that covers the use of `@_implements` on type
declarations. This will hide the `@_implements` attribute from older
compilers.
2024-03-11 14:28:20 -07:00
Doug Gregor
a06e3c8d5d Add a test where the same type is both and async sequence and its iterator 2024-03-11 13:16:14 -07:00