swiftlang / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Apache License 2.0
3.13k stars 393 forks source link

Mark MacroSpec as Sendable #2679

Closed j-f1 closed 1 month ago

j-f1 commented 1 month ago

Without making this change, compiling the default XCTestCase created for a macro project under Swift 6 will produce the error “Let testMacros is not concurrency-safe because non-Sendable type [String : MacroSpec] may have shared mutable state.” Fortunately there is no shared mutable state here — syntax nodes are already Sendable, and metatypes are also Sendable.

j-f1 commented 1 month ago

@swift-ci please test

ahoppen commented 1 month ago

Would you mind also cherry-picking this change to release/6.0? https://github.com/apple/swift-syntax/blob/main/CONTRIBUTING.md#opening-a-pr-for-release-branch