Skip to content

Commit 8a48cd9

Browse files
committed
Bypass lifetime diagnostics in interfaces for copied arguments.
Briefly (April 2025), RawSpan._extracting, Span._extracting, and UTF8Span.span returned a borrowed value that depended on a copied argument. Continue to support those interfaces. The implementations were correct but needed an explicit _overrideLifetime.
1 parent 78758da commit 8a48cd9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ private struct DiagnoseDependence {
219219
log(" has dependent function result")
220220
return .continueWalk
221221
}
222+
// Briefly (April 2025), RawSpan._extracting, Span._extracting, and UTF8Span.span returned a borrowed value that
223+
// depended on a copied argument. Continue to support those interfaces. The implementations were correct but
224+
// needed an explicit _overrideLifetime.
225+
if let sourceFileKind = dependence.function.sourceFileKind, sourceFileKind == .interface {
226+
return .continueWalk
227+
}
222228
}
223229
return .abortWalk
224230
}

0 commit comments

Comments
 (0)