Skip to content

Commit 806121d

Browse files
authored
Merge pull request #2357 from hborla/minor-concurrency-annotations
[NFC] Minor annotations to minimize diagnostics under strict concurrency checking.
2 parents d9ae448 + bc74142 commit 806121d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Sources/SwiftSyntax/BumpPtrAllocator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
public class BumpPtrAllocator {
1818
typealias Slab = UnsafeMutableRawBufferPointer
1919

20-
static private var GROWTH_DELAY: Int = 128
21-
static private var SLAB_ALIGNMENT: Int = 8
20+
static private let GROWTH_DELAY: Int = 128
21+
static private let SLAB_ALIGNMENT: Int = 8
2222

2323
/// Initial slab size.
2424
private var slabSize: Int

Sources/SwiftSyntax/MemoryLayout.swift

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

1313
// See `MemoryLayoutTest.swift`.
1414
@_spi(Testing) public enum SyntaxMemoryLayout {
15-
public struct Value: Equatable {
15+
public struct Value: Equatable, Sendable {
1616
var size: Int
1717
var stride: Int
1818
var alignment: Int

Sources/SwiftSyntax/Raw/RawSyntax.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ extension RawSyntax: Identifiable {
945945
}
946946

947947
/// See `SyntaxMemoryLayout`.
948-
var RawSyntaxDataMemoryLayouts: [String: SyntaxMemoryLayout.Value] = [
948+
let RawSyntaxDataMemoryLayouts: [String: SyntaxMemoryLayout.Value] = [
949949
"RawSyntaxData": .init(RawSyntaxData.self),
950950
"RawSyntaxData.Layout": .init(RawSyntaxData.Layout.self),
951951
"RawSyntaxData.ParsedToken": .init(RawSyntaxData.ParsedToken.self),

Sources/SwiftSyntax/Syntax.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ extension Syntax {
309309
public struct SyntaxNode {}
310310

311311
/// See `SyntaxMemoryLayout`.
312-
var SyntaxMemoryLayouts: [String: SyntaxMemoryLayout.Value] = [
312+
let SyntaxMemoryLayouts: [String: SyntaxMemoryLayout.Value] = [
313313
"Syntax": .init(Syntax.self),
314314
"Syntax.Info": .init(Syntax.Info.self),
315315
"Syntax.Info.Root": .init(Syntax.Info.Root.self),

Sources/SwiftSyntax/SyntaxIdentifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public struct SyntaxIndexInTree: Comparable, Hashable, Sendable {
1616
let indexInTree: UInt32
1717

18-
static var zero: SyntaxIndexInTree = SyntaxIndexInTree(indexInTree: 0)
18+
static let zero: SyntaxIndexInTree = SyntaxIndexInTree(indexInTree: 0)
1919

2020
/// Assuming that this index points to the start of ``Raw``, so that it points
2121
/// to the next sibling of ``Raw``.

0 commit comments

Comments
 (0)