Commit Graph

250 Commits

Author SHA1 Message Date
Jakub Florek
5dbe202087 Merge pull request #77140 from MAJKFL/swift-lexical-lookup-validation
[SwiftLexicalLookup] New unqualified lookup implementation validation
2024-12-18 17:29:47 +01:00
Andrew Trick
c71e53d363 Add LifetimeDependenceDiagnoseTrivial feature.
A feature flag is needed so that newer compilers can build older standard
library interfaces.
2024-12-16 16:09:37 -08:00
Henrik G. Olsson
ec8ea94fb9 Infer @PointerBounds macro from clang __counted_by parameters (#77387)
This results in an automatic wrapper function with safe pointer types
when the imported function has bounds attributes. This exercises similar
pathways as the recently added functionality for specifying macros from
swift_attr. The new functionality is guarded by the experimental
language feature SafeInteropWrappers.

rdar://97942270
2024-12-11 13:36:56 -08:00
Joe Groff
ac7a61679d Add an @_addressableSelf attribute to mark the self param of methods as addressable. 2024-12-06 16:54:01 -08:00
Joe Groff
3c0b08dbcb Prototype an @_addressable attribute that puts an argument at a stable address.
Many APIs using nonescapable types would like to vend interior pointers to their
parameter bindings, but this isn't normally always possible because of representation
changes the caller may do around the call, such as moving the value in or out of memory,
bridging or reabstracting it, etc. `@_addressable` forces the corresponding parameter
to be passed indirectly in memory, in its maximally-abstracted representation.
[TODO] If return values have a lifetime dependency on this parameter, the caller must
keep this in-memory representation alive for the duration of the dependent value's
lifetime.
2024-12-03 20:39:23 -08:00
Jakub Florek
866f1c1c04 Merge branch 'main' into swift-lexical-lookup-validation 2024-11-26 09:37:23 +01:00
Meghana Gupta
ae28d667ff Introduce LifetimeDependence experimental feature 2024-11-18 18:08:32 -08:00
Jakub Florek
4b544e963a Merge branch 'main' into swift-lexical-lookup-validation 2024-11-13 15:54:30 +01:00
Doug Gregor
531a1ab4c4 Temporarily put uses of "Span" and "RawSpan" behind an experimental feature flag
While Span is present, we don't yet have an official way to create Span
instances. Until then, put uses of Span and RawSpan behind an
experimental feature flag (`Span`) that must be set to use these.

Addresses rdar://139308307.
2024-11-11 16:18:33 -08:00
Rintaro Ishizaki
29482f3b0f [AST] Remove 'usesFeatureParserDiagnostics(Decl *)' function
'ParserDiagnostics' experimental feature has been removed.
2024-11-06 10:57:17 -08:00
Sima Nerush
4ee76c55b4 [SE-0449] Remove GlobalActorInferenceCutoff feature flag. 2024-11-04 12:15:55 -08:00
Pavel Yaskevich
5d77f3ca01 [Frontend] NFC: Remove KeyPathWithStaticMembers feature flag
This is a temporary way to land SE-0438 changes without disrupting
anything else.
2024-10-30 10:53:42 -07:00
Jakub Florek
1d94844322 Add SwiftLexicalLookup validation. 2024-10-20 12:12:22 +02:00
Michael Gottesman
0e0665bfbd [concurrency] Add support for HopToMainActorIfNeededThunk.
It is behind the experimental flag GenerateForceToMainActorThunks.
2024-10-17 13:31:39 -07:00
Nate Chandler
49a2831d3f [CoroutineAccessors] Old ABI may be used via flag.
Add a setting to IRGenOptions and key off of it to emit yield_once_2
coroutines using either (1) the same code-path as yield_once coroutines
or (2) a new, not-yet implemented code-path.

Add flags to set the value in both directions.  During bringup, by
default, use the existing caller-allocated ABI.
2024-10-11 08:25:02 -07:00
Nate Chandler
11b5d27594 [CoroutineAccessors] Add flag to observe errors.
Temporarily allow the legacy behavior of allowing caller coroutine
accessors to observe errors (i.e. by executing no code after the yield
if the caller threw an error) behind the
CoroutineAccessorsUnwindOnCallerError flag.
2024-10-11 08:25:02 -07:00
Gabor Horvath
cf3b333eb6 [cxx-interop] Add flag to assume C++ types are resilient
Currently, C++ types cannot appear in resilient interfaces. There are
some cases where this is overly restrictive. We plan to improve the
logic to detect what types should not appear on resilient moduel
boundaries. In the meantime, this PR introduces a flag to disable these
errors. Users relying on this flag are on their own, this should only be
a temporary workaround until we land further improvements to this
diagnostic.

rdar://137457118
2024-10-09 11:47:10 +01:00
Doug Gregor
70980b95f8 Add experimental feature MacrosOnImporters for applying macro to imported decl
This is still very much experimental and we don't want to accidentally
enable it everywhere.
2024-10-08 11:12:55 -07:00
Konrad `ktoso` Malawski
dea3b59331 Merge pull request #76250 from ktoso/wip-experimental-isolated-deinit 2024-10-03 17:19:10 +09:00
nate-chandler
ba8f8ea282 Merge pull request #76526 from nate-chandler/general-coro/20240906/1
[CoroutineAccessors] Initial framing.
2024-09-30 07:04:04 -07:00
Konrad `ktoso` Malawski
45b97f146b Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-30 13:47:39 +09:00
Amritpan Kaur
6066418340 Merge pull request #73242 from amritpan/metatype-kp-implementation 2024-09-28 02:46:15 -07:00
Amritpan Kaur
8ebc928649 Guard feature behind experimental flag. 2024-09-27 22:42:04 -07:00
Nate Chandler
98a2e6a7df [CoroutineAccessors] Added modify.
The name is a placeholder for the mutating single-yield coroutine
accessor.
2024-09-26 18:10:39 -07:00
Nate Chandler
66e6c59681 [Features] Added CoroutineAccessors. 2024-09-26 18:10:38 -07:00
Allan Shortlidge
d373036805 SE-0444: Promote MemberImportVisibility to an upcoming feature.
The proposal has been accepted, so `MemberImportVisibility` is no longer
experimental.

Resolves rdar://126284512.
2024-09-26 13:41:14 -07:00
Allan Shortlidge
0fb36a5f39 AST: Make $SpecializeAttributeWithAvailability a baseline feature.
It has been available since at least Swift 5.8.
2024-09-23 21:48:09 -07:00
Konrad `ktoso` Malawski
d89347bed0 Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-20 18:34:45 +09:00
Sima Nerush
7e5a57a07a Guard the changes behind an experimental feature flag. 2024-09-19 10:09:56 -07:00
Gábor Horváth
4d01253674 Merge pull request #76429 from swiftlang/gaborh/safe-cxx-interop-mode
[cxx-interop] Introduce a safe C++ interop mode
2024-09-19 17:25:28 +01:00
Michael Gottesman
fb281331b3 Merge pull request #76558 from gottesmm/pr-39b63781333d46b16f086a7c192efc67b26255db
[concurrency] Behind the flag UnspecifiedMeansMainActorIsolated, try inferring by default main actor isolation instead of nonisolated for unspecified.
2024-09-19 09:18:33 -07:00
Gabor Horvath
929c0ca7d8 [cxx-interop] Introduce a safe C++ interop mode
In this mode all C++ types are imported as unsafe by default. Users
explicitly marking types are escapable or not escapable can make them
imported as safe. In the future, we also want to import unannotated
functions as unsafe and add more logic to infer types that are actually
safe, like agregates of escapable types.
2024-09-19 12:34:07 +01:00
Michael Gottesman
3843899c19 [concurrency] Behind the flag UnspecifiedMeansMainActorIsolated, try inferring by default main actor isolation instead of nonisolated for unspecified.
Just to play with.
2024-09-18 13:23:23 -07:00
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Meghana Gupta
68bfc0d3b4 Make NonEscapableTypes as a suppressible experimental feature 2024-09-13 13:13:17 -07:00
Alejandro Alonso
451e7259a1 Add ValueGenerics experimental feature 2024-09-04 15:13:49 -07:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
Doug Gregor
571859f294 Move "unsafe" diagnostics from errors to warnings
Warnings fit better with the approach we're going for, and can be
escalated to errors by `-warnings-as-errors` for clients that need it.
2024-08-19 14:34:00 -07:00
Doug Gregor
cccf6c1114 Introduce @unsafe and the ability to prohibit use of unsafe declarations
Allow any declaration to be marked with `@unsafe`, meaning that it
involves unsafe code. This also extends to C declarations marked with
the `swift_attr("unsafe")` attribute.

Under a separate experimental flag (`DisallowUnsafe`), diagnose any
attempt to use an `@unsafe` declaration or any unsafe language feature
(such as `unowned(unsafe)`, `@unchecked Sendable`). This begins to
define a "safe" mode in Swift that prohibits memory-unsafe constructs.
2024-08-19 14:33:07 -07:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Alex Hoppen
dcee673688 Merge pull request #74522 from mateusrodriguesxyz/trailing-comma 2024-08-06 18:51:18 -07:00
Sima Nerush
6400a294a8 Merge pull request #70227 from simanerush/same-element-requirements
[Requirement Machine] Implement same-element requirements.
2024-08-06 14:24:33 -07:00
Mateus Rodrigues
ac57e61278 Merge branch 'main' into trailing-comma 2024-08-06 09:34:43 -03:00
Joe Groff
de687db20f Disallow consuming self in a noncopyable deinit again.
The changes to allow for partial consumption unintentionally also allowed for
`self` to be consumed as a whole during `deinit`, which we don't yet want to
allow because it could lead to accidental "resurrection" and/or accidental
infinite recursion if the consuming method lets `deinit` be implicitly run
again. This makes it an error again. The experimental feature
`ConsumeSelfInDeinit` will allow it for test coverage or experimentation
purposes. rdar://132761460
2024-07-29 21:20:14 -07:00
Joe Groff
51829c17bf @_extern is an experimental feature.
Mark it as such. rdar://132013078
2024-07-18 11:46:16 -07:00
Holly Borla
dbda2738a6 [Features] Gate same-element requirements behind an experimental feature flag. 2024-07-15 10:19:32 -07:00
Kavon Farvardin
4529f3b295 Merge pull request #75183 from kavon/remove-reverse-condfail-workaround
NCGenerics: remove the reverse-condfail workaround
2024-07-12 09:39:12 -07:00
Kavon Farvardin
5b2f2cbfcf NCGenerics: remove the reverse-condfail workaround
This should no longer be needed, after having staged the first set of
changes in, as it was a temporary workaround.

resolves rdar://131560183
2024-07-11 14:30:27 -07:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00