Skip to content

Commit 48a0f06

Browse files
authored
Merge pull request #2445 from ahoppen/ahoppen/revert-sendable-conformances
Revert "Merge pull request #2425 from ahoppen/ahoppen/sendable-conformances"
2 parents 7733d30 + aeb51f8 commit 48a0f06

File tree

67 files changed

+234
-416
lines changed

Some content is hidden

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

67 files changed

+234
-416
lines changed

CodeGeneration/Sources/generate-swift-syntax/templates/swiftparser/ExperimentalFeaturesFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let experimentalFeaturesFile = SourceFileSyntax(leadingTrivia: copyrightHeader)
2020
"""
2121
extension Parser {
2222
@_spi(ExperimentalLanguageFeatures)
23-
public struct ExperimentalFeatures: OptionSet, Sendable {
23+
public struct ExperimentalFeatures: OptionSet {
2424
public let rawValue: UInt
2525
public init(rawValue: UInt) {
2626
self.rawValue = rawValue

CodeGeneration/Sources/generate-swift-syntax/templates/swiftparser/LayoutNodesParsableFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let layoutNodesParsableFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
4141
defer { withExtendedLifetime(parser) {} }
4242
let node = parser.\(parserFunction)()
4343
let raw = RawSyntax(parser.parseRemainder(into: node))
44-
return Syntax(raw: raw, rawNodeArena: parser.arena).cast(Self.self)
44+
return Syntax(raw: raw, rawNodeArena: raw.arena).cast(Self.self)
4545
}
4646
}
4747
"""

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/KeywordFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let lookupTable = ArrayExprSyntax(leftSquare: .leftSquareToken(trailingTrivia: .
2424
let keywordFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
2525
try! EnumDeclSyntax(
2626
"""
27-
public enum Keyword: UInt8, Hashable, Sendable
27+
public enum Keyword: UInt8, Hashable
2828
"""
2929
) {
3030
for keyword in Keyword.allCases {

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxEnumFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let syntaxEnumFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
1919
try! EnumDeclSyntax(
2020
"""
2121
/// Enum to exhaustively switch over all different syntax nodes.
22-
public enum SyntaxEnum: Sendable
22+
public enum SyntaxEnum
2323
"""
2424
) {
2525
DeclSyntax("case token(TokenSyntax)")

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxKindFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let syntaxKindFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
1919
try! EnumDeclSyntax(
2020
"""
2121
/// Enumerates the known kinds of Syntax represented in the Syntax tree.
22-
public enum SyntaxKind: Sendable
22+
public enum SyntaxKind
2323
"""
2424
) {
2525
DeclSyntax("case token")

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxRewriterFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
5050
}
5151
5252
return withExtendedLifetime(rewritten) {
53-
return Syntax(node).replacingSelf(rewritten.raw, rawNodeArena: rewritten.raw.arenaReference.retained, allocationArena: SyntaxArena())
53+
return Syntax(node).replacingSelf(rewritten.raw, rawNodeArena: rewritten.raw.arena, allocationArena: SyntaxArena())
5454
}
5555
}
5656
"""

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/TokenKindFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let tokenKindFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
1919
try! EnumDeclSyntax(
2020
"""
2121
/// Enumerates the kinds of tokens in the Swift language.
22-
public enum TokenKind: Hashable, Sendable
22+
public enum TokenKind: Hashable
2323
"""
2424
) {
2525
for tokenSpec in Token.allCases.map(\.spec) {

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/TriviaPiecesFile.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let triviaPiecesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
2626
///
2727
/// In general, you should deal with the actual Trivia collection instead
2828
/// of individual pieces whenever possible.
29-
public enum TriviaPiece: Sendable
29+
public enum TriviaPiece
3030
"""
3131
) {
3232
for trivia in TRIVIAS {
@@ -176,7 +176,7 @@ let triviaPiecesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
176176
/// In contrast to ``TriviaPiece``, a ``RawTriviaPiece`` does not own the source
177177
/// text of the trivia.
178178
@_spi(RawSyntax)
179-
public enum RawTriviaPiece: Equatable, Sendable
179+
public enum RawTriviaPiece: Equatable
180180
"""
181181
) {
182182
for trivia in TRIVIAS {

Sources/SwiftDiagnostics/Diagnostic.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SwiftSyntax
1414

15-
public struct Diagnostic: CustomDebugStringConvertible, Sendable {
15+
public struct Diagnostic: CustomDebugStringConvertible {
1616
/// The message that should be displayed to the user
1717
public let diagMessage: DiagnosticMessage
1818

@@ -74,7 +74,7 @@ public struct Diagnostic: CustomDebugStringConvertible, Sendable {
7474
}
7575
}
7676

77-
public struct DiagnosticsError: Error, Sendable {
77+
public struct DiagnosticsError: Error {
7878
public var diagnostics: [Diagnostic]
7979

8080
/// The diagnostics must contain at least one with severity == `.error`.

Sources/SwiftDiagnostics/FixIt.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SwiftSyntax
1515
/// Types conforming to this protocol represent Fix-It messages that can be
1616
/// shown to the client.
1717
/// The messages should describe the change that the Fix-It will perform
18-
public protocol FixItMessage: Sendable {
18+
public protocol FixItMessage {
1919
/// The Fix-It message that should be displayed in the client.
2020
var message: String { get }
2121

@@ -24,8 +24,8 @@ public protocol FixItMessage: Sendable {
2424
}
2525

2626
/// A Fix-It that can be applied to resolve a diagnostic.
27-
public struct FixIt: Sendable {
28-
public enum Change: Sendable {
27+
public struct FixIt {
28+
public enum Change {
2929
/// Replace `oldNode` by `newNode`.
3030
case replace(oldNode: Syntax, newNode: Syntax)
3131
/// Replace the leading trivia on the given token

Sources/SwiftDiagnostics/Message.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public enum DiagnosticSeverity: Sendable {
3535

3636
/// Types conforming to this protocol represent diagnostic messages that can be
3737
/// shown to the client.
38-
public protocol DiagnosticMessage: Sendable {
38+
public protocol DiagnosticMessage {
3939
/// The diagnostic message that should be displayed in the client.
4040
var message: String { get }
4141

Sources/SwiftDiagnostics/Note.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SwiftSyntax
1515
/// Types conforming to this protocol represent note messages that can be
1616
/// shown to the client.
1717
/// The messages should describe what the note is pointing at.
18-
public protocol NoteMessage: Sendable {
18+
public protocol NoteMessage {
1919
/// The message that should be displayed in the client.
2020
var message: String { get }
2121

@@ -31,7 +31,7 @@ extension NoteMessage {
3131
}
3232

3333
/// A note that points to another node that's relevant for a Diagnostic.
34-
public struct Note: CustomDebugStringConvertible, Sendable {
34+
public struct Note: CustomDebugStringConvertible {
3535
/// The node whose location the node is pointing.
3636
public let node: Syntax
3737

Sources/SwiftIDEUtils/SyntaxClassification.swift

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

1313
@_spi(RawSyntax) import SwiftSyntax
1414

15-
public enum SyntaxClassification: Sendable {
15+
public enum SyntaxClassification {
1616
/// An attribute starting with an `@`.
1717
case attribute
1818
/// A block comment starting with `/**` and ending with `*/.

Sources/SwiftIDEUtils/SyntaxClassifier.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fileprivate struct TokenKindAndText {
8585
}
8686

8787
/// Represents a source range that is associated with a syntax classification.
88-
public struct SyntaxClassifiedRange: Equatable, Sendable {
88+
public struct SyntaxClassifiedRange: Equatable {
8989
public var kind: SyntaxClassification
9090
public var range: ByteSourceRange
9191

@@ -264,7 +264,7 @@ private struct ClassificationVisitor {
264264
}
265265

266266
/// Provides a sequence of ``SyntaxClassifiedRange``s for a syntax node.
267-
public struct SyntaxClassifications: Sequence, Sendable {
267+
public struct SyntaxClassifications: Sequence {
268268
public typealias Iterator = Array<SyntaxClassifiedRange>.Iterator
269269

270270
var classifications: [SyntaxClassifiedRange]

Sources/SwiftOperators/Operator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import SwiftSyntax
1919
public typealias OperatorName = String
2020

2121
/// Describes the kind of an operator.
22-
public enum OperatorKind: String, Sendable {
22+
public enum OperatorKind: String {
2323
/// Infix operator such as the + in a + b.
2424
case infix
2525

@@ -31,7 +31,7 @@ public enum OperatorKind: String, Sendable {
3131
}
3232

3333
/// Describes an operator.
34-
public struct Operator: Sendable {
34+
public struct Operator {
3535
public let kind: OperatorKind
3636
public let name: OperatorName
3737
public let precedenceGroup: PrecedenceGroupName?

Sources/SwiftOperators/OperatorError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import SwiftSyntax
1313

1414
/// Describes errors that can occur when working with user-defined operators.
15-
public enum OperatorError: Error, Sendable {
15+
public enum OperatorError: Error {
1616
/// Error produced when a given precedence group already exists in the
1717
/// precedence graph.
1818
case groupAlreadyExists(existing: PrecedenceGroup, new: PrecedenceGroup)

Sources/SwiftOperators/OperatorTable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import SwiftSyntax
1919
/// semantic representation, validating the correctness of those declarations,
2020
/// and "folding" sequence expression syntax into a structured expression
2121
/// syntax tree.
22-
public struct OperatorTable: Sendable {
22+
public struct OperatorTable {
2323
var precedenceGraph: PrecedenceGraph = .init()
2424
var infixOperators: [OperatorName: Operator] = [:]
2525
var prefixOperators: [OperatorName: Operator] = [:]

Sources/SwiftOperators/PrecedenceGraph.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import SwiftSyntax
1414

1515
/// Describes the relative precedence of two groups.
16-
enum Precedence: Sendable {
16+
enum Precedence {
1717
case unrelated
1818
case higherThan
1919
case lowerThan
@@ -35,7 +35,7 @@ enum Precedence: Sendable {
3535

3636
/// A graph formed from a set of precedence groups, which can be used to
3737
/// determine the relative precedence of two precedence groups.
38-
struct PrecedenceGraph: Sendable {
38+
struct PrecedenceGraph {
3939
/// The known set of precedence groups, found by name.
4040
var precedenceGroups: [PrecedenceGroupName: PrecedenceGroup] = [:]
4141

Sources/SwiftOperators/PrecedenceGroup.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import SwiftSyntax
1818
public typealias PrecedenceGroupName = String
1919

2020
/// The associativity of a precedence group.
21-
public enum Associativity: String, Sendable {
21+
public enum Associativity: String {
2222
/// The precedence group is nonassociative, meaning that one must
2323
/// parenthesize when there are multiple operators in a sequence, e.g.,
2424
/// if ^ was nonassociative, a ^ b ^ c would need to be disambiguated as
@@ -38,9 +38,9 @@ public enum Associativity: String, Sendable {
3838

3939
/// Describes the relationship of a precedence group to another precedence
4040
/// group.
41-
public struct PrecedenceRelation: Sendable {
41+
public struct PrecedenceRelation {
4242
/// Describes the kind of a precedence relation.
43-
public enum Kind: Sendable {
43+
public enum Kind {
4444
case higherThan
4545
case lowerThan
4646

@@ -93,7 +93,7 @@ public struct PrecedenceRelation: Sendable {
9393
/// precedence, e.g.,
9494
///
9595
/// infix operator *: MultiplicationPrecedence
96-
public struct PrecedenceGroup: Sendable {
96+
public struct PrecedenceGroup {
9797
/// The name of the group, which must be unique.
9898
public var name: PrecedenceGroupName
9999

Sources/SwiftParser/CollectionNodes+Parsable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fileprivate extension SyntaxCollection {
4545
} else {
4646
// First unwrap: We know that children.last exists because children is not empty
4747
// Second unwrap: This is a collection and collections never have optional children. Thus the last child can’t be nil.
48-
let lastWithRemainder = parser.parseRemainder(into: layoutView.children[layoutView.children.count - 1]!)
48+
let lastWithRemainder = parser.parseRemainder(into: layoutView.children.last!!)
4949
let raw = layoutView.replacingChild(at: layoutView.children.count - 1, with: lastWithRemainder, arena: parser.arena)
5050
return Syntax(raw: raw, rawNodeArena: parser.arena).cast(Self.self)
5151
}

Sources/SwiftParser/IncrementalParseTransition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fileprivate struct SyntaxCursor {
283283
/// The raw `edits` of this struct are guaranteed to
284284
/// 1. not be overlapping.
285285
/// 2. be in increasing source offset order.
286-
public struct ConcurrentEdits: Sendable {
286+
public struct ConcurrentEdits {
287287
enum ConcurrentEditsError: Error, CustomStringConvertible {
288288
case editsNotConcurrent
289289

Sources/SwiftParser/ParseSourceFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ extension Parser {
132132
///
133133
/// This contains the parsed syntax tree and additional information on how far the parser looked ahead to parse each node.
134134
/// This information is required to perform an incremental parse of the tree after applying edits to it.
135-
public struct IncrementalParseResult: Sendable {
135+
public struct IncrementalParseResult {
136136
/// The syntax tree from parsing source
137137
public let tree: SourceFileSyntax
138138
/// The lookahead ranges for syntax nodes describe

Sources/SwiftParser/Parser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ class LookaheadTrackerOwner {
850850
}
851851

852852
/// Record the lookahead ranges for syntax nodes.
853-
public struct LookaheadRanges: Sendable {
853+
public struct LookaheadRanges {
854854
/// For each node that is recorded for re-use, the number of UTF-8 bytes that the parser looked ahead to parse the node, measured from the start of the node’s leading trivia.
855855
///
856856
/// This information can be used to determine whether a node can be reused in incremental parse. A node can only be re-used if no byte in its looked range has changed.

Sources/SwiftParser/generated/ExperimentalFeatures.swift

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

1515
extension Parser {
1616
@_spi(ExperimentalLanguageFeatures)
17-
public struct ExperimentalFeatures: OptionSet, Sendable {
17+
public struct ExperimentalFeatures: OptionSet {
1818
public let rawValue: UInt
1919

2020
public init(rawValue: UInt) {

0 commit comments

Comments
 (0)