Skip to content

Commit 09a91d8

Browse files
Merge pull request #2845 from swiftwasm/main
[pull] swiftwasm from main
2 parents cd63202 + 38efe16 commit 09a91d8

File tree

194 files changed

+67664
-2159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+67664
-2159
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ CHANGELOG
2828
Swift Next
2929
----------
3030

31+
* [SE-0299][]:
32+
33+
It is now possible to use leading-dot syntax in generic contexts to access static members of protocol extensions where `Self` is constrained to a fully concrete type:
34+
35+
```swift
36+
public protocol ToggleStyle { ... }
37+
38+
public struct DefaultToggleStyle: ToggleStyle { ... }
39+
40+
extension ToggleStyle where Self == DefaultToggleStyle {
41+
public static var `default`: Self { .init() }
42+
}
43+
44+
struct Toggle {
45+
func applyToggle<T: ToggleStyle>(_ style: T) { ... }
46+
}
47+
48+
Toggle(...).applyToggle(.default)
49+
```
50+
3151
* Whenever a reference to `Self` does not impede the usage of a protocol as a value type, or a protocol member on a value of protocol type, the same is now true for references to `[Self]` and `[Key : Self]`:
3252

3353
```swift

include/swift-c/SyntaxParser/SwiftSyntaxParser.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ typedef struct {
103103
uint16_t leading_trivia_count;
104104
uint16_t trailing_trivia_count;
105105
swiftparse_token_kind_t kind;
106+
/// Represents the range for the node, including trivia.
107+
swiftparse_range_t range;
106108
} swiftparse_token_data_t;
107109

108110
typedef struct {
@@ -115,9 +117,6 @@ typedef struct {
115117
swiftparse_token_data_t token_data;
116118
swiftparse_layout_data_t layout_data;
117119
};
118-
/// Represents the range for the node. For a token node the range includes
119-
/// the trivia associated with it.
120-
swiftparse_range_t range;
121120
/// The syntax kind. A value of '0' means this is a token node.
122121
swiftparse_syntax_kind_t kind;
123122
bool present;

include/swift/ABI/MetadataValues.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,8 @@ namespace SpecialPointerAuthDiscriminators {
11831183
const uint16_t AsyncContextYield = 0xe207; // = 57863
11841184
const uint16_t CancellationNotificationFunction = 0x1933; // = 6451
11851185
const uint16_t EscalationNotificationFunction = 0x5be4; // = 23524
1186+
const uint16_t AsyncThinNullaryFunction = 0x0f08; // = 3848
1187+
const uint16_t AsyncFutureFunction = 0x720f; // = 29199
11861188

11871189
/// Swift async context parameter stored in the extended frame info.
11881190
const uint16_t SwiftAsyncContextExtendedFrameEntry = 0xc31a; // = 49946

include/swift/ABI/Task.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,15 @@ class FutureAsyncContext : public AsyncContext {
553553
using AsyncContext::AsyncContext;
554554
};
555555

556+
/// An asynchronous context within a task that describes a general "Future"
557+
/// task that was started with a closure context.
558+
class FutureClosureAsyncContext : public FutureAsyncContext {
559+
public:
560+
HeapObject *closureContext;
561+
562+
using FutureAsyncContext::FutureAsyncContext;
563+
};
564+
556565
} // end namespace swift
557566

558567
#endif

include/swift/AST/Builtins.def

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -747,14 +747,6 @@ BUILTIN_MISC_OPERATION_WITH_SILGEN(GetCurrentAsyncTask, "getCurrentAsyncTask", "
747747
/// Cancel the given asynchronous task.
748748
BUILTIN_MISC_OPERATION_WITH_SILGEN(CancelAsyncTask, "cancelAsyncTask", "", Special)
749749

750-
/// createAsyncTask(): (
751-
/// Int, Builtin.NativeObject?, @escaping () async throws -> Void
752-
/// ) -> Builtin.NativeObject
753-
///
754-
/// Create a new asynchronous task, given flags, an (optional) parent task, and
755-
/// a function to execute.
756-
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTask, "createAsyncTask", "", Special)
757-
758750
/// createAsyncTaskFuture(): (
759751
/// Int, Builtin.NativeObject?, @escaping () async throws -> T
760752
/// ) -> Builtin.NativeObject

include/swift/AST/Builtins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ llvm::AtomicOrdering decodeLLVMAtomicOrdering(StringRef O);
137137
bool canBuiltinBeOverloadedForType(BuiltinValueKind ID, Type Ty);
138138

139139
/// Retrieve the AST-level AsyncTaskAndContext type, used for the
140-
/// createAsyncTask builtin.
140+
/// createAsyncTask* builtins.
141141
Type getAsyncTaskAndContextType(ASTContext &ctx);
142142

143143
}

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@ REMARK(interface_file_lock_failure,none,
394394
REMARK(interface_file_lock_timed_out,none,
395395
"timed out waiting to acquire lock file for module interface '%0'", (StringRef))
396396

397+
ERROR(error_option_required,none, "option '%0' is required", (StringRef))
398+
ERROR(error_nonexistent_output_dir,none,
399+
"'-output-dir' argument '%0' does not exist or is not a directory", (StringRef))
400+
401+
397402
// Dependency Verifier Diagnostics
398403
ERROR(missing_member_dependency,none,
399404
"expected "

include/swift/AST/DiagnosticsSema.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4287,8 +4287,8 @@ ERROR(actor_isolated_non_self_reference,none,
42874287
"%select{from inside the actor|on 'self'}2",
42884288
(DescriptiveDeclKind, DeclName, bool, unsigned))
42894289
ERROR(actor_isolated_self_independent_context,none,
4290-
"actor-isolated %0 %1 can not be %select{referenced|mutated|used 'inout'}2 from an "
4291-
"'@actorIndependent' context",
4290+
"actor-isolated %0 %1 can not be %select{referenced|mutated|used 'inout'}2 from a "
4291+
"non-isolated context",
42924292
(DescriptiveDeclKind, DeclName, unsigned))
42934293
ERROR(actor_isolated_inout_state,none,
42944294
"actor-isolated %0 %1 cannot be passed 'inout' to"
@@ -4311,7 +4311,7 @@ ERROR(global_actor_from_other_global_actor_context,none,
43114311
(DescriptiveDeclKind, DeclName, Type, Type, unsigned, bool))
43124312
ERROR(global_actor_from_nonactor_context,none,
43134313
"%0 %1 isolated to global actor %2 can not be %select{referenced|mutated|used 'inout'}4"
4314-
" from %select{this|an '@actorIndependent'}3%select{| synchronous}5 context",
4314+
" from %select{this|a non-isolated}3%select{| synchronous}5 context",
43154315
(DescriptiveDeclKind, DeclName, Type, bool, unsigned, bool))
43164316
ERROR(actor_isolated_partial_apply,none,
43174317
"actor-isolated %0 %1 can not be partially applied",

include/swift/AST/SemanticAttrs.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
SEMANTICS_ATTR(STRING_EQUALS, "string.equals")
2828
SEMANTICS_ATTR(STRING_MAKE_UTF8, "string.makeUTF8")
29+
SEMANTICS_ATTR(STRING_GET_UTF8_CSTRING, "string.getUTF8CString")
2930
SEMANTICS_ATTR(STRING_ESCAPE_PERCENT_GET, "string.escapePercent.get")
3031
SEMANTICS_ATTR(STRING_CONCAT, "string.concat")
3132
SEMANTICS_ATTR(STRING_APPEND, "string.append")

include/swift/Option/Options.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ namespace options {
3838
ModuleInterfaceOption = (1 << 13),
3939
SupplementaryOutput = (1 << 14),
4040
SwiftAPIExtractOption = (1 << 15),
41+
SwiftSymbolGraphExtractOption = (1 << 16),
4142
};
4243

4344
enum ID {
4445
OPT_INVALID = 0, // This is not an option ID.
4546
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
4647
HELPTEXT, METAVAR, VALUES) \
47-
OPT_##ID,
48+
OPT_##ID,
4849
#include "swift/Option/Options.inc"
4950
LastOption
5051
#undef OPTION

0 commit comments

Comments
 (0)