Skip to content

[Sema] Move predates concurrency remarks to warnings #69417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -2538,11 +2538,11 @@ NOTE(add_nominal_sendable_conformance,none,
NOTE(add_generic_parameter_sendable_conformance,none,
"consider making generic parameter %0 conform to the 'Sendable' protocol",
(Type))
REMARK(add_predates_concurrency_import,none,
WARNING(add_predates_concurrency_import,none,
"add '@preconcurrency' to %select{suppress|treat}0 "
"'Sendable'-related %select{warnings|errors}0 from module %1"
"%select{| as warnings}0", (bool, Identifier))
REMARK(remove_predates_concurrency_import,none,
WARNING(remove_predates_concurrency_import,none,
"'@preconcurrency' attribute on module %0 is unused", (Identifier))
WARNING(remove_public_import,none,
"public import of %0 was not used in public declarations or inlinable code",
Expand Down
2 changes: 1 addition & 1 deletion test/ClangImporter/objc_async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

@available(SwiftStdlib 5.5, *)
@MainActor func onlyOnMainActor() { }
Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/actor_isolation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// REQUIRES: concurrency
// REQUIRES: asserts

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

let immutableGlobal: String = "hello"
var mutableGlobal: String = "can't touch this" // expected-note 5{{var declared here}}
Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/global_actor_serialized.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// a global-actor annotation that is an error in Swift 6, but only a warning
// in Swift 5, then we do not reject the import as an error.

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

// use it to force the right checks happen.
func test() async -> Int {
Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/predates_concurrency_import.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@preconcurrency import NonStrictModule
@_predatesConcurrency import StrictModule // expected-warning{{'@_predatesConcurrency' has been renamed to '@preconcurrency'}}
@preconcurrency import OtherActors
// expected-remark@-1{{'@preconcurrency' attribute on module 'OtherActors' is unused}}{{1-17=}}
// expected-warning@-1{{'@preconcurrency' attribute on module 'OtherActors' is unused}}{{1-17=}}

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

Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/sendable_without_preconcurrency_2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// REQUIRES: asserts

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

actor A {
func f() -> [StrictStruct: NonStrictClass] { [:] }
Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/voucher_propagation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// REQUIRES: OS=macosx

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

// These are an attempt to simulate some kind of async work, and the
Expand Down
15 changes: 0 additions & 15 deletions test/Frontend/SuppressRemarks.swift

This file was deleted.