Skip to content

Commit f06a058

Browse files
committed
AST: Delete the DeclarationUnavailableFromAsynchronousContext diagnostic group
This group has not shipped yet and was added mainly to support test coverage for d56b7df. Now that we have unit tests for this, delete the group, pending discussion.
1 parent 0eaea4c commit f06a058

File tree

4 files changed

+14
-33
lines changed

4 files changed

+14
-33
lines changed

include/swift/AST/DiagnosticGroups.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ GROUP(no_group, "")
2525
GROUP(DeprecatedDeclaration, "DeprecatedDeclaration.md")
2626
GROUP(Unsafe, "Unsafe.md")
2727
GROUP(UnknownWarningGroup, "UnknownWarningGroup.md")
28-
GROUP(DeclarationUnavailableFromAsynchronousContext, "DeclarationUnavailableFromAsynchronousContext.md")
2928

3029
#define UNDEFINE_DIAGNOSTIC_GROUPS_MACROS
3130
#include "swift/AST/DefineDiagnosticGroupsMacros.h"

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5962,7 +5962,7 @@ ERROR(async_decl_must_be_available_from_async,none,
59625962
ERROR(async_named_decl_must_be_available_from_async,none,
59635963
"asynchronous %kind0 must be available from asynchronous contexts",
59645964
(const ValueDecl *))
5965-
GROUPED_ERROR(async_unavailable_decl,DeclarationUnavailableFromAsynchronousContext,none,
5965+
ERROR(async_unavailable_decl,none,
59665966
"%kindbase0 is unavailable from asynchronous contexts%select{|; %1}1",
59675967
(const ValueDecl *, StringRef))
59685968

test/attr/attr_availability_noasync.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -print-diagnostic-groups
1+
// RUN: %target-typecheck-verify-swift
22

33
// REQUIRES: concurrency
44

@@ -27,16 +27,16 @@ actor IOActor {
2727

2828
@available(SwiftStdlib 5.5, *)
2929
func asyncFunc() async {
30-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
30+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
3131
basicNoAsync()
3232

33-
// expected-warning@+1{{global function 'messageNoAsync' is unavailable from asynchronous contexts; a message from the author; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
33+
// expected-warning@+1{{global function 'messageNoAsync' is unavailable from asynchronous contexts; a message from the author; this is an error in the Swift 6 language mode}}
3434
messageNoAsync()
3535

36-
// expected-warning@+1{{global function 'renamedNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}{{5-19=asyncReplacement}}
36+
// expected-warning@+1{{global function 'renamedNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}{{5-19=asyncReplacement}}
3737
renamedNoAsync() { _ in }
3838

39-
// expected-warning@+1{{global function 'readStringFromIO' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}{{13-29=IOActor.readString}}
39+
// expected-warning@+1{{global function 'readStringFromIO' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}{{13-29=IOActor.readString}}
4040
let _ = readStringFromIO()
4141
}
4242

@@ -76,7 +76,7 @@ func test_defers_sync() {
7676
}
7777

7878
func local_async_func() async {
79-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
79+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
8080
defer { basicNoAsync() }
8181
_ = ()
8282
}
@@ -89,7 +89,7 @@ func test_defers_sync() {
8989

9090
// local async closure
9191
let local_async_closure = { () async -> Void in
92-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
92+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
9393
defer { basicNoAsync() }
9494
_ = ()
9595
}
@@ -102,7 +102,7 @@ func test_defers_sync() {
102102

103103
var local_async_var: Void {
104104
get async {
105-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
105+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
106106
defer { basicNoAsync() }
107107
return ()
108108
}
@@ -112,9 +112,9 @@ func test_defers_sync() {
112112
@available(SwiftStdlib 5.5, *)
113113
func test_defer_async() async {
114114
defer {
115-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
115+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
116116
defer { basicNoAsync() }
117-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
117+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
118118
basicNoAsync()
119119
}
120120

@@ -124,7 +124,7 @@ func test_defer_async() async {
124124
}
125125

126126
func local_async_func() async {
127-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
127+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
128128
defer { basicNoAsync() }
129129
_ = ()
130130
}
@@ -136,7 +136,7 @@ func test_defer_async() async {
136136
_ = local_sync_closure
137137

138138
let local_async_closure = { () async -> Void in
139-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
139+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
140140
defer { basicNoAsync() }
141141
_ = ()
142142
}
@@ -149,7 +149,7 @@ func test_defer_async() async {
149149

150150
var local_async_var: Void {
151151
get async {
152-
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode [DeclarationUnavailableFromAsynchronousContext]}}
152+
// expected-warning@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts; this is an error in the Swift 6 language mode}}
153153
defer { basicNoAsync() }
154154
return ()
155155
}

userdocs/diagnostic_groups/DeclarationUnavailableFromAsynchronousContext.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)