Skip to content

Commit 6ff69a0

Browse files
authored
Merge pull request #69417 from bnbarham/remark-to-warning
[Sema] Move predates concurrency remarks to warnings
2 parents b527c59 + 36686d7 commit 6ff69a0

File tree

8 files changed

+8
-23
lines changed

8 files changed

+8
-23
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,11 +2564,11 @@ NOTE(add_nominal_sendable_conformance,none,
25642564
NOTE(add_generic_parameter_sendable_conformance,none,
25652565
"consider making generic parameter %0 conform to the 'Sendable' protocol",
25662566
(Type))
2567-
REMARK(add_predates_concurrency_import,none,
2567+
WARNING(add_predates_concurrency_import,none,
25682568
"add '@preconcurrency' to %select{suppress|treat}0 "
25692569
"'Sendable'-related %select{warnings|errors}0 from module %1"
25702570
"%select{| as warnings}0", (bool, Identifier))
2571-
REMARK(remove_predates_concurrency_import,none,
2571+
WARNING(remove_predates_concurrency_import,none,
25722572
"'@preconcurrency' attribute on module %0 is unused", (Identifier))
25732573
WARNING(remove_public_import,none,
25742574
"public import of %0 was not used in public declarations or inlinable code",

test/ClangImporter/objc_async.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import Foundation
88
import ObjCConcurrency
9-
// expected-remark@-1{{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'ObjCConcurrency'}}
9+
// expected-warning@-1{{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'ObjCConcurrency'}}
1010

1111
@available(SwiftStdlib 5.5, *)
1212
@MainActor func onlyOnMainActor() { }

test/Concurrency/actor_isolation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// REQUIRES: concurrency
99
// REQUIRES: asserts
1010

11-
import OtherActors // expected-remark{{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'OtherActors'}}{{1-1=@preconcurrency }}
11+
import OtherActors // expected-warning{{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'OtherActors'}}{{1-1=@preconcurrency }}
1212

1313
let immutableGlobal: String = "hello"
1414
var mutableGlobal: String = "can't touch this" // expected-note 5{{var declared here}}

test/Concurrency/global_actor_serialized.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// a global-actor annotation that is an error in Swift 6, but only a warning
1212
// in Swift 5, then we do not reject the import as an error.
1313

14-
import SerializedStruct // expected-remark {{add '@preconcurrency' to treat 'Sendable'-related errors from module 'SerializedStruct' as warnings}}
14+
import SerializedStruct // expected-warning {{add '@preconcurrency' to treat 'Sendable'-related errors from module 'SerializedStruct' as warnings}}
1515

1616
// use it to force the right checks happen.
1717
func test() async -> Int {

test/Concurrency/predates_concurrency_import.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@preconcurrency import NonStrictModule
1515
@_predatesConcurrency import StrictModule // expected-warning{{'@_predatesConcurrency' has been renamed to '@preconcurrency'}}
1616
@preconcurrency import OtherActors
17-
// expected-remark@-1{{'@preconcurrency' attribute on module 'OtherActors' is unused}}{{1-17=}}
17+
// expected-warning@-1{{'@preconcurrency' attribute on module 'OtherActors' is unused}}{{1-17=}}
1818

1919
func acceptSendable<T: Sendable>(_: T) { }
2020

test/Concurrency/sendable_without_preconcurrency_2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// REQUIRES: asserts
1010

1111
import StrictModule // no remark: we never recommend @preconcurrency due to an explicitly non-Sendable (via -warn-concurrency) type
12-
import NonStrictModule // expected-remark{{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'NonStrictModule'}}
12+
import NonStrictModule // expected-warning{{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'NonStrictModule'}}
1313

1414
actor A {
1515
func f() -> [StrictStruct: NonStrictClass] { [:] }

test/Concurrency/voucher_propagation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// REQUIRES: OS=macosx
1616

1717
import Darwin
18-
import Dispatch // expected-remark {{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Dispatch'}}
18+
import Dispatch // expected-warning {{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Dispatch'}}
1919
import StdlibUnittest
2020

2121
// These are an attempt to simulate some kind of async work, and the

test/Frontend/SuppressRemarks.swift

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

0 commit comments

Comments
 (0)