Skip to content

Commit 3995215

Browse files
committed
Fix a couple build warnings
1 parent d2e5bd7 commit 3995215

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Sources/CompletionScoring/Utilities/SwiftExtensions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ extension RandomAccessCollection {
232232
return body(scratchArea)
233233
}
234234

235-
package func concurrentCompactMap<T>(_ f: @Sendable (Element) -> T?) -> [T] where Self: Sendable {
235+
package func concurrentCompactMap<T>(_ f: @Sendable (Element) -> T?) -> [T] where Self: Sendable, Index: Sendable {
236236
return withMapScratchArea { (results: UnsafeMutablePointer<T?>) -> [T] in
237237
// `nonisolated(unsafe)` is fine because we write to different offsets within the buffer on every concurrent
238238
// iteration.
@@ -245,7 +245,7 @@ extension RandomAccessCollection {
245245
}
246246
}
247247

248-
package func concurrentMap<T>(_ f: @Sendable (Element) -> T) -> [T] where Self: Sendable {
248+
package func concurrentMap<T>(_ f: @Sendable (Element) -> T) -> [T] where Self: Sendable, Index: Sendable {
249249
return withMapScratchArea { (results: UnsafeMutablePointer<T>) -> [T] in
250250
// `nonisolated(unsafe)` is fine because we write to different offsets within the buffer on every concurrent
251251
// iteration.
@@ -290,7 +290,7 @@ protocol ContiguousZeroBasedIndexedCollection: Collection where Index == Int {
290290
}
291291

292292
extension ContiguousZeroBasedIndexedCollection {
293-
func slicedConcurrentForEachSliceRange(body: @Sendable (Range<Index>) -> Void) {
293+
func slicedConcurrentForEachSliceRange(body: @Sendable (Range<Index>) -> Void) where Self: SendableMetatype {
294294
// We want to use `DispatchQueue.concurrentPerform`, but we want to be called only a few times. So that we
295295
// can amortize per-callback work. We also want to oversubscribe so that we can efficiently use
296296
// heterogeneous CPUs. If we had 4 efficiency cores, and 4 performance cores, and we dispatched 8 work items

Sources/SKLogging/LoggingScope.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ package final class LoggingScope {
4343
package func withLoggingSubsystemAndScope<Result>(
4444
subsystem: String,
4545
scope: String?,
46-
@_inheritActorContext _ operation: @Sendable () throws -> Result
46+
_ operation: @Sendable () throws -> Result
4747
) rethrows -> Result {
4848
return try LoggingScope.$_subsystem.withValue(subsystem) {
4949
return try LoggingScope.$_scope.withValue(scope, operation: operation)

Sources/SourceKitLSP/Swift/CodeActions/SyntaxCodeActionProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import SwiftSyntax
1717

1818
/// Describes types that provide one or more code actions based on purely
1919
/// syntactic information.
20-
protocol SyntaxCodeActionProvider {
20+
protocol SyntaxCodeActionProvider: SendableMetatype {
2121
/// Produce code actions within the given scope. Each code action
2222
/// corresponds to one syntactic transformation that can be performed, such
2323
/// as adding or removing separators from an integer literal.

Sources/SwiftExtensions/AsyncUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ package func withCancellableCheckedThrowingContinuation<Handle: Sendable, Result
132132
)
133133
}
134134

135-
extension Collection where Element: Sendable {
135+
extension Collection where Self: Sendable, Element: Sendable {
136136
/// Transforms all elements in the collection concurrently and returns the transformed collection.
137137
package func concurrentMap<TransformedElement: Sendable>(
138138
maxConcurrentTasks: Int = ProcessInfo.processInfo.processorCount,

Tests/BuildSystemIntegrationTests/SwiftPMBuildSystemTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ struct SwiftPMBuildSystemTests {
770770
// We opened the project from a symlink. The realpath isn't part of the project and we should thus not receive
771771
// build settings for it.
772772
#expect(
773-
try await #require(
773+
try #require(
774774
await buildSystemManager.buildSettingsInferredFromMainFile(
775775
for: DocumentURI(aswiftReal),
776776
language: .swift,

0 commit comments

Comments
 (0)