Commit Graph

279 Commits

Author SHA1 Message Date
Allan Shortlidge
5fb8082cc2 AST: Promote various move-only features to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
e1082bb8be AST: Promote various macro features to baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
b517a44528 AST: Promote ParameterPacks feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
6b9b7bcd83 AST: Promote PrimaryAssociatedTypes2 feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
b5acc6b07d AST: Promote AsyncSequenceFailure feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
6f972fc275 AST: Promote AssociatedTypeAvailability feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
9e5a9b963f AST: Remove NoncopyableGenerics feature suppression.
It is no longer necessary to produce `.swiftinterface` files the support older
compilers that lack support for the NoncopyableGenerics feature. Cleaning this
up makes the stdlib `.swiftinterface` far more readable.
2024-07-08 17:44:24 -07:00
Allan Shortlidge
ee8a1152b2 Concurrency: Promote BuiltinCreateTask feature to baseline. 2024-07-02 22:26:55 -07:00
Allan Shortlidge
7e181d17e5 Concurrency: Promote BuiltinCreateAsyncDiscardingTaskInGroupWithExecutor feature to baseline. 2024-07-02 22:26:55 -07:00
Allan Shortlidge
e5744f04d6 Concurrency: Promote BuiltinCreateAsyncDiscardingTaskInGroup feature to baseline. 2024-07-02 22:26:55 -07:00
Allan Shortlidge
a4d58671ba Concurrency: Promote BuiltinCreateAsyncTaskInGroupWithExecutor feature to baseline. 2024-07-02 22:26:54 -07:00
Allan Shortlidge
f2519650ae Concurrency: Promote BuiltinBuildComplexEqualityExecutor feature to baseline. 2024-07-02 22:26:54 -07:00
Allan Shortlidge
ba630c0da5 Concurrency: Promote BuiltinBuildTaskExecutorRef feature to baseline. 2024-07-02 22:26:54 -07:00
Michael Gottesman
34195ff213 Merge pull request #74610 from gottesmm/pr-324fd70c13e87a329334341aae4667f2d1be152c
[sending] Remove transferring.
2024-07-02 14:02:18 -07:00
Xiaodi Wu
e1f537107f Merge branch 'main' into trailing-comma 2024-06-29 16:36:06 -04:00
Kavon Farvardin
1e2111afca NCGenerics: add flag to opt-out SE-427 strictness
This is mainly for tests to avoid the reverse condfail.
2024-06-26 17:10:33 -07:00
Michael Gottesman
112071e57d [sending] Remove transferring.
Out of an abundance of caution, we:

1. Left in parsing support for transferring but internally made it rely on the
internals of sending.

2. Added a warning to tell people that transferring was going to
be removed very soon.

Now that we have given people some time, remove support for parsing
transferring.

rdar://130253724
2024-06-21 16:03:21 -07:00
Tim Kientzle
1098054291 Merge branch 'main' into tbkka-assertions2 2024-06-18 17:52:00 -07:00
Mateus Rodrigues
013997dae7 Implement trailing comma for comma-separated lists 2024-06-18 14:01:38 -03:00
Meghana Gupta
af1d6017f9 Merge pull request #74132 from meg-gupta/deleteresultdependson
Remove resultDependsOn/resultDependsOnSelf
2024-06-06 10:23:31 -07:00
Joe Groff
efc193ffa3 Merge pull request #74154 from jckarter/treat-reinit-attempts-in-multi-block-defers-as-errors
Turn mishandled reinitialize-in-`defer`-after-`consume` cases into errors.
2024-06-05 21:04:34 -07:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Joe Groff
74aaf88697 Turn mishandled reinitialize-in-defer-after-consume cases into errors.
The handling of multi-basic-block control flow in `defer` blocks looks like it
was left incomplete and completely untested; I fixed a few obvious problems but
it still completely lacks any analysis of conditional reinitializations. For now,
change it to treat attempted reinitializations as uses-after-consumes so we raise
reliable errors now instead of emitting code that causes memory corruption at
runtime. Fixes rdar://129303198.
2024-06-05 14:12:00 -07:00
Meghana Gupta
470fa2f365 Remove resultDependsOn/resultDependsOnSelf 2024-06-05 11:36:16 -07:00
Michael Gottesman
11f86a5488 [sending] Teach sending how to suppress sending from functions passed to inits.
rdar://129045783
2024-05-30 22:19:11 -07:00
Michael Gottesman
14c4576889 [sending] Make it so that we suppress fields of Nominal Types in API notes.
rdar://129045783
2024-05-30 22:19:11 -07:00
Doug Gregor
2388acdfd3 [SE-0415] Enable function body macros by default
Preamble macros are *not* part of the revised SE-0415, so leave them
experimental.

Tracked by rdar://119687390.
2024-05-20 22:08:33 -07:00
Michael Gottesman
b780ff6696 [sending] Begin parsing 'sending' while still accepting 'transferring'.
A few things:

1. Internally except for in the parser and the clang importer, we only represent
'sending'. This means that it will be easy to remove 'transferring' once enough
time has passed.

2. I included a warning that suggested to the user to change 'transferring' ->
'sending'.

3. I duplicated the parsing diagnostics for 'sending' so both will still get
different sets of diagnostics for parsing issues... but anywhere below parsing,
I have just changed 'transferring' to 'sending' since transferring isn't
represented at those lower levels.

4. Since SendingArgsAndResults is always enabled when TransferringArgsAndResults
is enabled (NOTE not vis-a-versa), we know that we can always parse sending. So
we import "transferring" as "sending". This means that even if one marks a
function with "transferring", the compiler will guard it behind a
SendingArgsAndResults -D flag and in the imported header print out sending.

rdar://128216574
2024-05-16 21:43:50 -07:00
Michael Gottesman
e3e78ad6bb [sending] Change the internals of sending to be based around 'sending' instead of 'transferring'.
We still only parse transferring... but this sets us up for adding the new
'sending' syntax by first validating that this internal change does not mess up
the current transferring impl since we want both to keep working for now.

rdar://128216574
2024-05-16 12:20:45 -07:00
Kavon Farvardin
b5383ab4da NFC: use clear terminology 2024-05-09 11:23:25 -07:00
nate-chandler
387e8d3ff1 Merge pull request #73516 from nate-chandler/rdar127755503
[BitwiseCopyable] Avoid a condfail.
2024-05-09 07:00:01 -07:00
Nate Chandler
2671652085 [BitwiseCopyable] Avoid a condfail.
The standard library defines
```
protocol BitwiseCopyable {}
typealias _BitwiseCopyable = BitwiseCopyable
```
For current compilers, `BitwiseCopyable` is a "known protocol".

For older compilers, it is not; instead `_BitwiseCopyable` is.  So
print the following into the swiftinterface for those older compilers:
```
protocol _BitwiseCopyable {}
typealias BitwiseCopyable = _BitwiseCopyable
```

rdar://127755503
2024-05-08 16:53:14 -07:00
Kavon Farvardin
f0f91eedc9 NCGenerics: avoid feature-guarding in some cases
With the generalization of Optional to support noncopyable types, our
feature-guarding in swiftinterface files would double-print functions
that simply refer to the Optional type.

Since NoncopyableGenerics is a suppressible feature, by default
a second version of Optional and UnsafePointer are emitted into
swiftinterface files, where the ~Copyable generalization is stripped
away.

We can rely on that to avoid double-printing the function, if the types
substituted for the generic parameters are all Copyable.

We need a bit more checking for when
`@_disallowFeatureSuppression(NoncopyableGenerics)` is used, since this
trick relies on there always being a definition of the type we refer to,
whether the feature is enabled or not.

resolves rdar://127389991
2024-05-08 15:48:54 -07:00
Holly Borla
a7920ce50b [Features] Replace -enable-nonfrozen-enum-exhaustivity-diagnostics with an
upcoming feature.

The bespoke flag still works as a way to enable the `NonfrozenEnumExhaustivity`
upcoming feature. `NonfrozenEnumExhaustivity` is enabled by default in the
Swift 6 language mode as errors, and enabled by default in the Swift 5 language
mode as warnings.
2024-05-06 20:56:20 -07:00
Becca Royal-Gordon
981233ad37 Merge pull request #73128 from beccadax/objcimpl-resilient
Handle resilient stored properties in objcImpl
2024-04-30 20:50:33 -07:00
Michael Gottesman
dc25857805 [transferring] Make transferring suppressible and validate that we do suppress transferring in swift interface files.
Importantly I added tests that validated this behavior.

rdar://126780823
2024-04-30 16:40:40 -07:00
Becca Royal-Gordon
f94ed6d606 Hide objcImpl resilience support behind feature
Resilence support will require changes to the Objective-C runtime to expand support for metadata initialization functions. Add a separate experimental feature flag to help with staging that support in, and modify diagnostics to not suggest increasing the minimum deployment target for now.
2024-04-30 12:03:46 -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
Kavon Farvardin
6fc812397e Fix classification of non-generic noncopyables
We should not feature-guard types that use `~Copyable` only in an
inheritance clause.
2024-04-19 11:34:48 -07:00
Dave Lee
e57f70bd4d [Debugging] Add DebugDescriptionMacro experimental feature (#73107)
This removes the leading underscore from the macro.
2024-04-18 17:25:44 -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
Allan Shortlidge
d43816567f AST: Rename ExtensionImportVisibility to MemberImportVisibility.
This feature controls lookup behavior for members in general, not just
extension members.

Resolves rdar://126491324
2024-04-16 16:29:51 -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
Pavel Yaskevich
3a0acf8043 [AST/Sema] Decouple @preconcurrency conformances from DynamicActorIsolation feature flag 2024-04-14 21:28:13 -07:00
Nate Chandler
943cc3cc7c [NoncopyablePartialConsumption] Enable.
SE-429 was accepted.

rdar://126275392
2024-04-11 08:19:29 -07:00
Erik Eckstein
a980452e59 Add the experimental attribute @sensitive for struct declarations
The attribute declares that a struct contains "sensitive" data.
It enforces that the contents of such a struct value is zeroed out at the end of its lifetime.
In other words: the content of such a value is not observable in memory after the value's lifetime.

Also add an experimental feature `Sensitive` with which the attribute can be enabled.
2024-04-09 12:01:10 +02:00
Kuba Mracek
7d44c2be48 [Volatile] Add a -enable-experimental-feature Volatile 2024-04-05 15:13:30 -07:00
Doug Gregor
61b19c8fbf Merge branch 'main' into import-extension-visibility 2024-04-03 21:43:21 -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
Alejandro Alonso
36bf2ae3bf Merge pull request #72592 from Azoy/raw-layout-inst
[IRGen] Add Builtin.addressOfRawLayout
2024-03-29 07:38:37 -07:00